<?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 Using repeated measures in Proc glimmix in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196644#M10508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following question. I've carried out a study in which 96 animals were involved. They were spread over four rounds, so in each round 24 animals were followed up. In each round, animals were spread over 4 treatments, so in each round I had 6 animals per treatment. Treatments in the four rounds were the same.&lt;/P&gt;&lt;P&gt;Each round lasted for two weeks and animals were observed on day 2, 4, 6, 8, 10&amp;nbsp; and 12. &lt;/P&gt;&lt;P&gt;I want to use proc glimmix to verify differences between the four treatments. However, I have repeated measures for each animals (6 different days) and I'm not sure how to include this.&lt;/P&gt;&lt;P&gt;At first I used the following procedure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc glimmix data=dataset;&lt;/P&gt;&lt;P&gt;class animal treatment day;&lt;/P&gt;&lt;P&gt;model y = treatment day/dist=binary;&lt;/P&gt;&lt;P&gt;random animal;&lt;/P&gt;&lt;P&gt;lsmeans treatment/pdiff;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in this way I'm not taking into account the repeated measures per animal. I feel like I need to change the random statement but I'm not sure how.&lt;/P&gt;&lt;P&gt;Do you have any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Mar 2015 16:18:51 GMT</pubDate>
    <dc:creator>NathalieJ</dc:creator>
    <dc:date>2015-03-07T16:18:51Z</dc:date>
    <item>
      <title>Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196644#M10508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following question. I've carried out a study in which 96 animals were involved. They were spread over four rounds, so in each round 24 animals were followed up. In each round, animals were spread over 4 treatments, so in each round I had 6 animals per treatment. Treatments in the four rounds were the same.&lt;/P&gt;&lt;P&gt;Each round lasted for two weeks and animals were observed on day 2, 4, 6, 8, 10&amp;nbsp; and 12. &lt;/P&gt;&lt;P&gt;I want to use proc glimmix to verify differences between the four treatments. However, I have repeated measures for each animals (6 different days) and I'm not sure how to include this.&lt;/P&gt;&lt;P&gt;At first I used the following procedure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc glimmix data=dataset;&lt;/P&gt;&lt;P&gt;class animal treatment day;&lt;/P&gt;&lt;P&gt;model y = treatment day/dist=binary;&lt;/P&gt;&lt;P&gt;random animal;&lt;/P&gt;&lt;P&gt;lsmeans treatment/pdiff;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in this way I'm not taking into account the repeated measures per animal. I feel like I need to change the random statement but I'm not sure how.&lt;/P&gt;&lt;P&gt;Do you have any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Mar 2015 16:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196644#M10508</guid>
      <dc:creator>NathalieJ</dc:creator>
      <dc:date>2015-03-07T16:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196645#M10509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glimmix data=dataset method=laplace;&lt;/P&gt;&lt;P&gt;class animal treatment data;&lt;/P&gt;&lt;P&gt;model y=treatment day treatment*day/dist=binary;&lt;/P&gt;&lt;P&gt;random intercept/subject=animal;&lt;/P&gt;&lt;P&gt;random day/type=ar(1) subject=animal;&lt;/P&gt;&lt;P&gt;lsmeans treatment/diff ilink;&lt;/P&gt;&lt;P&gt;lsmeans treatment*day/slicediff=day ilink;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give a conditional estimate of the effects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following will be somewhat biased, due to regression to the mean, but is a marginal approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glimmix data=dataset;&lt;/P&gt;&lt;P&gt;class animal treatment data;&lt;/P&gt;&lt;P&gt;model y=treatment day treatment*day/dist=binary;&lt;/P&gt;&lt;P&gt;random intercept/subject=animal;&lt;/P&gt;&lt;P&gt;random day/residual type=ar(1) subject=animal;&lt;/P&gt;&lt;P&gt;lsmeans treatment/diff ilink;&lt;/P&gt;&lt;P&gt;lsmeans treatment*day/slicediff=day ilink;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend Walter Stroup's text: &lt;EM&gt;Generalized Linear Mixed Models&lt;/EM&gt; if you are going to work in SAS on this analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2015 16:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196645#M10509</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-03-09T16:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196646#M10510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Dear Steve,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I do have a problem with AR(1) while using Glimmix procedure. I have seen that you are very familiar with that command, so I decided to contact you directly. Your help would be more than important and valuable for me at this point. My problem is related to the Glimmix warning: obtaining minimum variance quadratic unbiased estimated as starting values for the covariance parameters failed. I have seen that you have addressed this question in the past&amp;nbsp; with the following command:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;random studyday /residual&amp;nbsp; type=&amp;amp;covtype subject= anml_nbr ;*group=grp_no;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%if "&amp;amp;covtype" = "AR(1)" OR "&amp;amp;covtype" = "ARH(1)" %then %do;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;random intercept/subject=anml_nbr;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%end;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have panel data with racially motivated crimes are my dependent variable. The data are structured as pooled cross-national time series, where time is nested . In other words, my dependent and independent variables were collected over time at the regional level. I have detected significant autocorrelation in my dependent variable. There is also an issue of heteroskedasticity.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Here is the command I use:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;PROC GLIMMIX DATA=WORK.SAS NOLCPRINT;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;CLASS REGION_ID;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;MODEL=RACIST_CRIME IMMIGRATION GDP DENSITY TREND /SOLUTION DIST=POI LINK=LOG OFFSET=POPUL_LOG DDFM=BW;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;RANDOM INTERCEPT/SUB=REGION_ID TYPE =AR(1) RESIDUAL;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;RUN;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I was told to use REPEATED instead of RANDOM, but the former seems to be appropriate only for proc mixed. Here instead I should use RANDOM ... RESIDUAL.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I do not receive the&amp;nbsp; warning when I exclude RESIDUAL, but then I get 0 for the estimate for AR(1)&amp;nbsp; and missing value for its standard error. Thus, I do not think I control for autocorrletation in my data.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: Arial, sans-serif; font-size: 13.3333330154419px;"&gt;When I include RANDOM&amp;nbsp; RESIDUAL, I get the warning: obtaining minimum variance...I&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: Arial, sans-serif; font-size: 13.3333330154419px;"&gt; have read that I should use AR(1) plus random effects.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have read that I should use AR(1) plus random effects. Could you please tell me how to incorporate that? Or perhaps I should use different TYPE. I would be extremely thankful for any help.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sincerely,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sylwia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 03:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196646#M10510</guid>
      <dc:creator>spiatkowska</dc:creator>
      <dc:date>2015-04-03T03:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196647#M10511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to be so late in replying but vacay got in the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say that time is nested, do you mean that the time points differ from one region_id to another?&amp;nbsp; Also, are the time points equally spaced?&amp;nbsp; Unless both of these hold, autoregressive structures as implemented in MIXED or GLIMMIX aren't appropriate.&amp;nbsp; Until we address that point, you might try the following untested code.&amp;nbsp; It assumes that immigration, GDP, density and trend are all continuous variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;PROC GLIMMIX DATA=WORK.SAS NOLCPRINT;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;CLASS REGION_ID timepoint;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;MODEL RACIST_CRIME= IMMIGRATION GDP DENSITY TREND timepoint /SOLUTION DIST=POI LINK=LOG OFFSET=POPUL_LOG DDFM=BW;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;RANDOM timepoint/SUB=REGION_ID TYPE =AR(1) RESIDUAL;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;Now if the timepoints are unequally spaced, and not truly the same across region_id, you may have to address this through the use of a spline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px;"&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 11:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/196647#M10511</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-04-09T11:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/312823#M16491</link>
      <description>&lt;P&gt;I have been reading quit a bit on the topic but I'm still somewhat confused...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case I have an experiment with animals that was replicated 3 years.&lt;BR /&gt;Ten animals are used in each year for each of two treatments; &amp;nbsp;at the end of the year &amp;nbsp;they are replaced with&amp;nbsp;new but similar animals.&lt;/P&gt;&lt;P&gt;The variable of interest is the animal's weight. Weights were recorded for animals in two Treatments, at irregularly spaced (Time) intervals (intervals vary between years, but not within years) . My main interest is the weights&amp;nbsp;evolution over time, i.e. the regression of weight on time and treatment, but I also should lke to determine if Year had an effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My model then should be &amp;nbsp;(?) &amp;nbsp; &amp;nbsp; Weight= Treatment &amp;nbsp;Time &amp;nbsp;Treatment*Time;&lt;/P&gt;&lt;P&gt;I suspect that the random statement should be something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;random intercept AnimalNumber Time / subject Year;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read that the covariance structure in the random statement above should be specified by type=sp(pow) given the &amp;nbsp;irregular time intervals&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;covtest 'random slope coeff=0' ...0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would certainly appreciate feedback on the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2016 19:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/312823#M16491</guid>
      <dc:creator>rivina</dc:creator>
      <dc:date>2016-11-19T19:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/315685#M16637</link>
      <description>&lt;P&gt;In the GLIMMIX documentation for SAS/STAT 14.1 there is an example where bodyweights of cows at unequally spaced time points is analyzed. &amp;nbsp;See:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_glimmix_examples09.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_glimmix_examples09.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may help you get started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve Denham&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 20:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/315685#M16637</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2016-11-30T20:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using repeated measures in Proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/315711#M16638</link>
      <description>Thanks Steve. After posting my inquire I found the example, quite useful.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 30 Nov 2016 22:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-repeated-measures-in-Proc-glimmix/m-p/315711#M16638</guid>
      <dc:creator>rivina</dc:creator>
      <dc:date>2016-11-30T22:10:46Z</dc:date>
    </item>
  </channel>
</rss>

