<?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: Repeated measures on calculated variables in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605458#M29410</link>
    <description>&lt;P&gt;The code you are using is never wasted. It may be that you missed an option.&lt;/P&gt;
&lt;P&gt;Some example data so that we can see what actually happens that goes with the code is best practice so we don't make lots of assumptions about what you may be doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every time I see something about rates (per day for example) flags start going off about what may go not quite right with combining those rates.&lt;/P&gt;
&lt;P&gt;And when you do "daily growth" does your data have "daily records"?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 17:01:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-19T17:01:52Z</dc:date>
    <item>
      <title>Repeated measures on calculated variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605422#M29406</link>
      <description>&lt;P&gt;I am struggling with something which I believe is of no issue, but I cannot wrap my mind around it. The following is the issue:&lt;/P&gt;&lt;P&gt;Lets assume I run a trial in which I measure growth of a broiler from day 0-42, measuring every 7 days. Each 7 days, I myself calculate the daily growth, simply by dividing the growth of those 7 days by 7. When I analyze bodyweight of these birds using the repeated statement, the lsmeans of the model align with the actual means that I have measured. When I analyze the daily weight gain, the lsmeans of the individual timepoints align with my actual means, but the lsmeans of the average daily weight gain do not align with the calculated 0-42 weight gain (a +- 10% difference is not abnormal). Is it still valid to use the repeated measurement statement with a variable that is not measured, but calculated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 15:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605422#M29406</guid>
      <dc:creator>GavinB</dc:creator>
      <dc:date>2019-11-19T15:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated measures on calculated variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605458#M29410</link>
      <description>&lt;P&gt;The code you are using is never wasted. It may be that you missed an option.&lt;/P&gt;
&lt;P&gt;Some example data so that we can see what actually happens that goes with the code is best practice so we don't make lots of assumptions about what you may be doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every time I see something about rates (per day for example) flags start going off about what may go not quite right with combining those rates.&lt;/P&gt;
&lt;P&gt;And when you do "daily growth" does your data have "daily records"?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 17:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605458#M29410</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-19T17:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated measures on calculated variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605460#M29411</link>
      <description>&lt;P&gt;There is nothing inherently wrong with using calculated variables in a modeling exercise. Thus, my conclusion is that you are doing something wrong somewhere.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 17:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/605460#M29411</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-19T17:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated measures on calculated variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/606883#M29448</link>
      <description>&lt;P&gt;Example of a code that I would run:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics /imagemap=on;
proc mixed data=performance2 plots=all;
class TT time box block; 
model DWG=TT|time/ ddfm=kenwardroger s cl influence(est effect=box iter=5) outp=mixout;
repeated time /subject=box type=un;
random INT/subject=block s cl;
store mixmodel;
run;
proc plm restore=mixmodel;
effectplot interaction(x=time sliceby=TT) / ilink clm connect;
slice TT*time/ sliceby=time pdiff=all cl ilink means plots=diffogram lines adjdfe=row adjust=simulate;
lsmeans TT/ pdiff=all adjust=simulate means lines;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My time would be the timepoints at which I have measured the bodyweight. If I run this piece of code with bodyweight the lsmeans are quite close to the actual means. If I run it with daily weight gain (as I said before, I calculate this value by substracting previous BW with new BW and dividing this by the # of days) the lsmeans of the entire period (&lt;U&gt;Not the individual timepoints)&lt;/U&gt; are quite far off...... Example of the dataset:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34211iCCD9E07E24E0DAF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 07:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/606883#M29448</guid>
      <dc:creator>GavinB</dc:creator>
      <dc:date>2019-11-25T07:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated measures on calculated variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/606935#M29449</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154926"&gt;@GavinB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Example of a code that I would run:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics /imagemap=on;
proc mixed data=performance2 plots=all;
class TT time box block; 
model DWG=TT|time/ ddfm=kenwardroger s cl influence(est effect=box iter=5) outp=mixout;
repeated time /subject=box type=un;
random INT/subject=block s cl;
store mixmodel;
run;
proc plm restore=mixmodel;
effectplot interaction(x=time sliceby=TT) / ilink clm connect;
slice TT*time/ sliceby=time pdiff=all cl ilink means plots=diffogram lines adjdfe=row adjust=simulate;
lsmeans TT/ pdiff=all adjust=simulate means lines;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My time would be the timepoints at which I have measured the bodyweight. If I run this piece of code with bodyweight the lsmeans are quite close to the actual means. If I run it with daily weight gain (as I said before, I calculate this value by substracting previous BW with new BW and dividing this by the # of days) the lsmeans of the entire period (&lt;U&gt;Not the individual timepoints)&lt;/U&gt; are quite far off...... Example of the dataset:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34211iCCD9E07E24E0DAF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We don't have your data, so we can't run your code; please provide a representative portion of your data that illustrates the problem following these instructions (&lt;STRONG&gt;and not via an attached file&lt;/STRONG&gt;). &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also haven't shown us the allegedly incorrect output and correct output, which I think is required for us to understand the issue. And you are making an incorrect assumption: "the lsmeans are quite close to the actual means", which does not have to be true in all situations, and depends on a lot of things, including the presence of "balanced data". Is there something else allegedly incorrect, or is the only thing that is incorrect that the lsmeans are not close to the actual means?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 13:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Repeated-measures-on-calculated-variables/m-p/606935#M29449</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-25T13:05:26Z</dc:date>
    </item>
  </channel>
</rss>

