<?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 Re: Average Repeated Measures in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759109#M36968</link>
    <description>&lt;P&gt;I ended up using&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
 create table want as
 select a.*, avg(CONCEN) as CONCEN_AVG
 from have as a group by ID, PERIOD, TYPE;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I compared the results to the results from PROC SUMMARY method. Both are the same!&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2021 17:55:43 GMT</pubDate>
    <dc:creator>mariko5797</dc:creator>
    <dc:date>2021-08-03T17:55:43Z</dc:date>
    <item>
      <title>Average Repeated Measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759080#M36965</link>
      <description>&lt;P&gt;Is there a simple way to average the repeated measures for a given measurement type during a certain time period for a specific subject? I think the simplest thing to do is to create a second concentration column ("CONCEN_AVG"). However, I am not sure how to implement this idea. Is there a simpler way than making multiple subsets?&lt;/P&gt;&lt;P&gt;I would want the average of all the white blood cell counts during period 1 for subject 1, and so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariko5797_0-1628008903879.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62215i159ABD6F4159C0F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariko5797_0-1628008903879.png" alt="mariko5797_0-1628008903879.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariko5797_1-1628009203485.png" style="width: 537px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62216i3CBC8510464D04FE/image-dimensions/537x552?v=v2" width="537" height="552" role="button" title="mariko5797_1-1628009203485.png" alt="mariko5797_1-1628009203485.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note:&lt;/EM&gt; Measurements are arbitrary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759080#M36965</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2021-08-03T16:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Average Repeated Measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759089#M36966</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
proc summary data=have nway;
    class id period type;
    var concen;
    output out=means mean=concen_avg;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can merge data set MEANS with data set HAVE, by ID PERIOD TYPE, to get the final table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to (as the next step, which you didn't say) subtract the mean from each value, the easier way is to use PROC STDIZE.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 17:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759089#M36966</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-03T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Average Repeated Measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759109#M36968</link>
      <description>&lt;P&gt;I ended up using&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
 create table want as
 select a.*, avg(CONCEN) as CONCEN_AVG
 from have as a group by ID, PERIOD, TYPE;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I compared the results to the results from PROC SUMMARY method. Both are the same!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 17:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759109#M36968</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2021-08-03T17:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Average Repeated Measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759292#M36981</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311553"&gt;@mariko5797&lt;/a&gt;&amp;nbsp;, PROC SQL and PROC SUMMARY ought to give the same answers when using the AVG function in PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I point out that if you are ever in the situation where you want two (or more) slicing of the data, such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;group by ID, PERIOD, TYPE&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;group by ID, PERIOD&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(which happens to me regularly) then PROC SUMMARY is less programming ... and only one pass through the data, while PROC SQL requires two queries and two passes through the data. If you have huge data sets this could save quite a bit of execution time (and of course, PROC SUMMARY saves you some programming effort)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 12:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Average-Repeated-Measures/m-p/759292#M36981</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-04T12:06:06Z</dc:date>
    </item>
  </channel>
</rss>

