<?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 What is the code for Repeated Measures? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946595#M47297</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your urgent help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 16 plants treated with 16 different fertilizers and a control plant (untreated), for a total of 17 units. The pots were randomly arranged without replication. However, these plants were fertilized for 27 weeks. What would be the repeated measure code for this? I want to see the effects of these fertilizers on plant height for 27 weeks. This is the coding I came up with. Thanks for your valuable time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;frt= fertilizers&amp;nbsp;&lt;/P&gt;&lt;P&gt;ph= plant height&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc glimmix Data =first;&lt;BR /&gt;class frt ph week;&lt;BR /&gt;model ph = fert week fert*week;&lt;BR /&gt;random week/subject=frt*rep type=ar(1) residual;&lt;BR /&gt;lsmeans fert*week / pdiff Adjust = Tukey lines slicediff= day;&lt;BR /&gt;output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2024 20:51:01 GMT</pubDate>
    <dc:creator>Zynep93</dc:creator>
    <dc:date>2024-10-07T20:51:01Z</dc:date>
    <item>
      <title>What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946595#M47297</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your urgent help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 16 plants treated with 16 different fertilizers and a control plant (untreated), for a total of 17 units. The pots were randomly arranged without replication. However, these plants were fertilized for 27 weeks. What would be the repeated measure code for this? I want to see the effects of these fertilizers on plant height for 27 weeks. This is the coding I came up with. Thanks for your valuable time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;frt= fertilizers&amp;nbsp;&lt;/P&gt;&lt;P&gt;ph= plant height&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc glimmix Data =first;&lt;BR /&gt;class frt ph week;&lt;BR /&gt;model ph = fert week fert*week;&lt;BR /&gt;random week/subject=frt*rep type=ar(1) residual;&lt;BR /&gt;lsmeans fert*week / pdiff Adjust = Tukey lines slicediff= day;&lt;BR /&gt;output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 20:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946595#M47297</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-07T20:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946689#M47306</link>
      <description>&lt;P&gt;Because you have no replication of your fertilizer treatments, other than in time, this looks like a classic growth curve comparison. I think your code might have some redundant parts, so consider the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc glimmix Data =first;
class frt ph week;
model ph = fert week fert*week;
random week/subject=frt type=ar(1) residual; /* Removed rep as it is confounded with tertilizer */
lsmeans fert*week / Adjust = Tukey lines slicediff= week; /* changed the slicediff to reflect the terms in the lsmeans, deleted the pdiff as the slicediff handles all differences of interest */
output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this helps. I have been pretty busy with my real world work and haven't been able to answer here as soon as folks need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 14:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946689#M47306</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2024-10-08T14:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946700#M47309</link>
      <description>Thanks so much Steve. Highly appreciated.</description>
      <pubDate>Tue, 08 Oct 2024 15:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946700#M47309</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-08T15:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946994#M47321</link>
      <description>The code gave an error. Here is the log;&lt;BR /&gt;&lt;BR /&gt;532 ;&lt;BR /&gt;533 run;&lt;BR /&gt;534 Proc glimmix Data =Waterford;&lt;BR /&gt;535 class frt ph week;&lt;BR /&gt;536 model ph = frt week frt*week;&lt;BR /&gt;537 random week/subject=frt type=ar(1) residual;&lt;BR /&gt;538 lsmeans frt*week / Adjust = Tukey lines slicediff= week;&lt;BR /&gt;539 output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;&lt;BR /&gt;540 run;&lt;BR /&gt;&lt;BR /&gt;ERROR: Least-squares means are not available for the multinomial distribution.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.SECOND may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;BR /&gt;NOTE: PROCEDURE GLIMMIX used (Total process time)&lt;BR /&gt;&lt;BR /&gt;Does that mean the data is not normally distributed?</description>
      <pubDate>Thu, 10 Oct 2024 14:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946994#M47321</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-10T14:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946997#M47323</link>
      <description>&lt;P&gt;It doesn't mean that - what it does mean is that you have included it in the CLASS statement. If a dependent variable is given in the CLASS statement, GLIMMIX defaults to a multinomial.&amp;nbsp; So, remove "ph" from the CLASS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 14:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946997#M47323</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2024-10-10T14:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946998#M47324</link>
      <description>log: NOTE: Some observations are not used in the analysis because of: missing response values (n=4), missing fixed effects (n=4).&lt;BR /&gt;WARNING: Mixed model has saturated mean and profiled variance. Fit does not proceed.&lt;BR /&gt;&lt;BR /&gt;It the data being interpolated? It seems like I have high-variance data, and it's not a good fit... ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Oct 2024 14:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/946998#M47324</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-10T14:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947003#M47325</link>
      <description>&lt;P&gt;This is what I feared when you described the experimental design. I would first try removing the main effects of frt and week from the MODEL statement leaving&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model ph =frt*week;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This one-way model would test whether any plant at any time point differed from any other plant at any time point. It should get away from the saturated mean/profiled variance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that does not work, consider analyzing the data with a generalized estimating equation approach (PROC GEE). Something like this may be possible:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc gee Data =first;
class frt  week;
model ph = week;
repeated subject=frt/type=ar(1) covb corrb;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this runs, we can work on getting marginal means and pairwise comparisons out later.&amp;nbsp; Additionally, look at Example 49.3 (SAS/STAT 15.2) Weighted GEE for Longitudinal Data That Have Missing Values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 14:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947003#M47325</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2024-10-10T14:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947014#M47326</link>
      <description>&lt;P&gt;Yes, the experimental design is not ideal, unfortunately.&lt;BR /&gt;When I run the proc gee, I do not see whether treatments differ from each other. I only see the week differences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there are 27 weeks but somehow the data mixed up with plant height data ( pls see the ss below)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;log:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;68&lt;/DIV&gt;&lt;DIV class=""&gt;69 data Waterford;&lt;/DIV&gt;&lt;DIV class=""&gt;70 infile datalines expandtabs truncover;&lt;/DIV&gt;&lt;DIV class=""&gt;71 input frt$ ph Week;&lt;/DIV&gt;&lt;DIV class=""&gt;72 datalines;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid data for ph in line 218 4-4.&lt;/DIV&gt;&lt;DIV class=""&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class=""&gt;218 FF H 71.12 9&lt;/DIV&gt;&lt;DIV class=""&gt;frt=FF ph=. Week=71.12 _ERROR_=1 _N_=146&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid data for ph in line 235 4-4.&lt;/DIV&gt;&lt;DIV class=""&gt;235 FF H 76.20 10&lt;/DIV&gt;&lt;DIV class=""&gt;frt=FF ph=. Week=76.2 _ERROR_=1 _N_=163&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid data for ph in line 320 4-4.&lt;/DIV&gt;&lt;DIV class=""&gt;320 FF H 142.24 15&lt;/DIV&gt;&lt;DIV class=""&gt;frt=FF ph=. Week=142.24 _ERROR_=1 _N_=248&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: Invalid data for ph in line 507 4-4.&lt;/DIV&gt;&lt;DIV class=""&gt;507 FF H 193.04 26&lt;/DIV&gt;&lt;DIV class=""&gt;frt=FF ph=. Week=193.04 _ERROR_=1 _N_=435&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-10-10 at 11.58.41 AM.png" style="width: 515px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101115i151BAB3F8E406AE4/image-dimensions/515x125?v=v2" width="515" height="125" role="button" title="Screenshot 2024-10-10 at 11.58.41 AM.png" alt="Screenshot 2024-10-10 at 11.58.41 AM.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Oct 2024 16:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947014#M47326</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-10T16:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947130#M47336</link>
      <description>&lt;P&gt;What does the "H" designate for the variable ph? Has the plant been harvested? If so, then it should be replaced with a period if it no longer exists, or perhaps with the last observation carried forward (LOCF method). Mixed modeling is robust to missing data when there is adequate replication. You will have to make a scientific decision as to how to proceed, based on what your research question is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 13:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947130#M47336</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2024-10-11T13:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the code for Repeated Measures?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947145#M47339</link>
      <description>&lt;P&gt;I've corrected that one in SAS. It is a letter from a treatment name with a space in between. I would like to have a pairwise comparison of treatments ( fertilizers) with letters. The hypothesis is that the fertilizers will increase the plant height.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried adding;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc gee Data =Waterford;&lt;BR /&gt;class frt week;&lt;BR /&gt;model ph=frt;&lt;BR /&gt;repeated subject=frt/type=ar(1) covb corrb;&lt;BR /&gt;lsmeans frt/ pdiff=all adjust=tukey LINES;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error: Only CLASS variables allowed in this effect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is it because we added cov, which is already LS means of covariances?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks Steve!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 14:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/What-is-the-code-for-Repeated-Measures/m-p/947145#M47339</guid>
      <dc:creator>Zynep93</dc:creator>
      <dc:date>2024-10-11T14:47:27Z</dc:date>
    </item>
  </channel>
</rss>

