<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I get differences between groups over time from PROC MEANS with CLASS statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-differences-between-groups-over-time-from-PROC/m-p/438270#M109250</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set that has variables time (1 to 46); group (3 different groups) and alc (a numeric variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data = ken.lsdalclong;
class time group;
var alc;
output out = ken.days mean = mean uclm = upper lclm = lower;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I get the mean, lcl and ucl of alc by time and group.&amp;nbsp; So far so good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get the differences between the means of the three groups by time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is, I want 46 values of (mean group 1 – mean group2) and 46 values of (mean group 1 – mean group3)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
    <pubDate>Sun, 18 Feb 2018 16:57:04 GMT</pubDate>
    <dc:creator>plf515</dc:creator>
    <dc:date>2018-02-18T16:57:04Z</dc:date>
    <item>
      <title>How do I get differences between groups over time from PROC MEANS with CLASS statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-differences-between-groups-over-time-from-PROC/m-p/438270#M109250</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set that has variables time (1 to 46); group (3 different groups) and alc (a numeric variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data = ken.lsdalclong;
class time group;
var alc;
output out = ken.days mean = mean uclm = upper lclm = lower;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I get the mean, lcl and ucl of alc by time and group.&amp;nbsp; So far so good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get the differences between the means of the three groups by time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is, I want 46 values of (mean group 1 – mean group2) and 46 values of (mean group 1 – mean group3)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 16:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-differences-between-groups-over-time-from-PROC/m-p/438270#M109250</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2018-02-18T16:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get differences between groups over time from PROC MEANS with CLASS statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-differences-between-groups-over-time-from-PROC/m-p/438277#M109252</link>
      <description>&lt;P&gt;If you examine the output data set, you will see that you have the pieces that you need.&amp;nbsp; It is just a matter of extracting the right pieces and re-assembling them properly.&amp;nbsp; Here is a starting point:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=ken.days prefix=mean_group out=want;&lt;/P&gt;
&lt;P&gt;id group;&lt;/P&gt;
&lt;P&gt;var mean;&lt;/P&gt;
&lt;P&gt;by time;&lt;/P&gt;
&lt;P&gt;where _type_=3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look first at KEN.DAYS to understand that the WHERE statement in PROC TRANSPOSE is selecting the proper observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then take a look at the output data set WANT which will need a few more calculations, but has the data assembled in an easy-to-calculate form.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 17:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-differences-between-groups-over-time-from-PROC/m-p/438277#M109252</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-18T17:17:49Z</dc:date>
    </item>
  </channel>
</rss>

