<?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: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649926#M31187</link>
    <description>&lt;P&gt;Thanks for the hint, but I don't know how to get around it.&amp;nbsp; The design is such that each animal has a unique pretreatment value that we wish to use as a covariate.&amp;nbsp; Consequently, there is complete confounding.&amp;nbsp; However, this never seems to be a problem when whole plots are just blocks, or there are no blocks. Off to SAS for Mixed Models, 2nd ed. pages 101-102, where not surprisingly, this exact design (without a covariate) is covered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Fri, 22 May 2020 15:11:23 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-05-22T15:11:23Z</dc:date>
    <item>
      <title>GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649674#M31175</link>
      <description>&lt;P&gt;In a repeated measures analysis of covariance, with the whole plot being a latin square and the repeated measurements on the subject per day and treatment (grp_no), we have been using the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=one(where=(param=700)) hessian IC=q ;
   nloptions maxiter=500;
   by segment param sex;
   class grp_no period day animnum;
   model value=COV grp_no  day animnum period grp_no*period period*animnum  period*day / solution ddfm=bw ;
   random intercept / subject = animnum(day grp_no);
   random period / type = AR(1) subject = animnum(day grp_no) residual;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now for some param classes in a new dataset (we do separate analyses by param class), this "works" while for others&amp;nbsp; (param=500 for example)&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;the log has the warningr "&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;Obtaining minimum variance quadratic unbiased estimates as starting values for the &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;covariance parameters failed."&amp;nbsp; To get around this we tried moving the continuous variable COV to the end of the MODEL statement like so&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model value= grp_no  day animnum period grp_no*period period*animnum  period*day &lt;/CODE&gt;COV/ solution ddfm=bw ;&lt;/PRE&gt;
&lt;P&gt;Well, that got rid of the warning.&lt;/P&gt;
&lt;P&gt;Here is the second oddity, under both MODEL statements, the Type3 table of F tests has 0 df for the numerator, missing df for the denominator and missing F value.&amp;nbsp; However, under the original MODEL statement (COV at beginning) there is an estimate, std error and probability reported in the solution vector for the param's that run.&amp;nbsp; When COV is at the end though, the solution vector has a zero as the estimate.&amp;nbsp; In fact, it looks like all of the other "set to zero" solution values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I come before you to gather any ideas on what might be going on here.&amp;nbsp; Is it a data sort issue? Is it a design issue?&amp;nbsp; The code for this has been validated for this design but with only a single animal per day - treatment combination.&amp;nbsp; The data here has 2 animals per day - treatment combination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh yeah, it works just fine if you remove the covariate COV, but the whole point of the analysis is to adjust for pre-treatment differences between animals.&amp;nbsp; This is all in SAS/STAT 14.1 (TS1M3).&amp;nbsp; Data is attached.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 18:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649674#M31175</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-21T18:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649715#M31177</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;I tested using the GLIMMIX code shown below using SAS 9.4TS1M6 with SAS/STAT 15.1 and was not able to replicate the warning message with COV as the first variable in the MODEL.&amp;nbsp; However, based upon your description it sounds to me as if there could be a singularity, confounding issue associated with data and model. I suspect the&amp;nbsp; COV variable is confounded either with another variable or levels of another variable. I added the htype=1,3 option to the MODEL statement and examined the NUM DF and noticed that the NUM DF differ between the TYPE I and TYPE 3.&amp;nbsp; If the degrees of freedom for a particular effect differ between the Type I and Type III tests, then there might be a confounding problem in the model. In my experience where the variables where the NUM DF differ tend to be involved in the confounded problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glimmix data=work.for_stats_segment1(where=(param=700)) ;&lt;BR /&gt;nloptions maxiter=500;&lt;BR /&gt;by segment param sex;&lt;BR /&gt;class grp_no period day animnum;&lt;BR /&gt;model value=grp_no day animnum period grp_no*period period*animnum period*day COV /&lt;BR /&gt;ddfm=bw htype=1,3;&lt;BR /&gt;random intercept / subject = animnum(day grp_no);&lt;BR /&gt;random period / type = AR(1) subject = animnum(day grp_no) residual;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 21:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649715#M31177</guid>
      <dc:creator>STAT_Kathleen</dc:creator>
      <dc:date>2020-05-21T21:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649730#M31178</link>
      <description>&lt;P&gt;It is an interesting problem. I did not get your error message with GLIMMIX, but I did duplicate your problem in the output. I tried this with PROC MIXED (changing the last statement to REPEATED) and got the message (with one of the orders for the covariate, can't remember which):&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Mixed: Convergence Status" frame="box" rules="all" cellspacing="0" cellpadding="3"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c data"&gt;
&lt;P&gt;WARNING: Stopped because of infinite likelihood&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;This typically means with repeated measures that you have more than one observation per time/subject combination, which is not allowed as you know. Quoting from the great&amp;nbsp;Kiernan et al. SASGF (2012) article:&lt;/P&gt;
&lt;P&gt;"PROC MIXED requires that you have one observation per repeated effect per subject. This note occurs when your&amp;nbsp;PROC MIXED step includes a REPEATED statement and the input data set has multiple observations at a given time&amp;nbsp;point for that particular subject."&lt;/P&gt;
&lt;P&gt;You said you had two observations per subject/time level.&amp;nbsp; But I am surprised that you did not get this error message with GLIMMIX. I think you need to define animal as the subject, or is that what is happening with your&amp;nbsp;animnum(day grp_no) subject?&amp;nbsp; Other things can give this error as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also think that Kathleen identified the other (maybe the first) problem. When I look at frequencies of the levels, using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=one(where=(param=700));&lt;BR /&gt;table grp_no*day*animnum / nopercents norow nocol;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;I see mostly zeroes, suggesting a possible coding issue with grp_no.&amp;nbsp; But I don't really know your data, so I can't say.&lt;/P&gt;
&lt;P&gt;I hope this gives you some ideas.&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 22:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649730#M31178</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2020-05-21T22:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649750#M31184</link>
      <description>&lt;P&gt;This sure is an interesting challenge. To follow on to the previous comment by Kathleen, it appears that cov and animnum are confounded in this dataset. Although cov is a continuous variable it only takes on 8 values, a unique one for each of the 8 levels of animnum. Easy to see with:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc freq data=one(where=(param=700));
	table animnum*cov / nopercents norow nocol;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I became suspicious when I looked at the solution table. The last level of animnum was 'estimated' as 0, as it must be with the matrix sweep of the overparameterized model. However, the next-to-last level is also 0 (with no SE). Suggests that animnum is confounded with something else.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 00:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649750#M31184</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2020-05-22T00:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649926#M31187</link>
      <description>&lt;P&gt;Thanks for the hint, but I don't know how to get around it.&amp;nbsp; The design is such that each animal has a unique pretreatment value that we wish to use as a covariate.&amp;nbsp; Consequently, there is complete confounding.&amp;nbsp; However, this never seems to be a problem when whole plots are just blocks, or there are no blocks. Off to SAS for Mixed Models, 2nd ed. pages 101-102, where not surprisingly, this exact design (without a covariate) is covered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 15:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649926#M31187</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-22T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649929#M31188</link>
      <description>&lt;P&gt;When in doubt about mixed models, there is always a great source of information - SAS for Mixed Models (whichever edition you happen to have).&amp;nbsp; We have a bunch of 2nd editions laying around, and on pages 101 to 102, the design used in this study is discussed (split-plot with whole plot as a Latin square).&amp;nbsp; The key is to get the row and column variables (animnum and day) into the RANDOM statement correctly.&amp;nbsp; Here is what worked:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=for_stats4(where=(param=500 )) hessian IC=q;
   nloptions maxiter=500;
   by segment param sex;
   class grp_no period day  animnum;
   model value=cov grp_no period grp_no*period  /*period*DAY period*animnum*/   /solution htype=(1 2 3) ddfm=bw;
   *random animnum day animnum*day;
   random intercept day/subject=animnum;
   random period / type = AR(1) subject = animnum*day residual;
   				lsmeans grp_no*period / 	slicediff=(period)
										adjust=simulate(cvadjust)  
										stepdown
										simpledifftype=control
										adjdfe=row;

				lsmeans grp_no / 	adjust=simulate(seed=1 nsamp=1000000) 
									diff=control
									stepdown
									adjdfe=row;
ods output 	lsmeans=_lsmeandat_4 tests1= _effectsdat1_4 tests3=_effectsdat3_4 slicediffs=_slicedat_4 diffs=_diffdat_4;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks to everyone who helped out on this -&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/330163"&gt;@STAT_Kathleen&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13758"&gt;@lvm&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1708"&gt;@sld&lt;/a&gt;&amp;nbsp;.&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>Fri, 22 May 2020 15:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649929#M31188</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-22T15:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649933#M31189</link>
      <description>And to the authors: Littell, Milliken, Stroup, Wolfinger and Schabenberger.  I wish there was a way to mark the book as a solution.&lt;BR /&gt;&lt;BR /&gt;SteveDenham</description>
      <pubDate>Fri, 22 May 2020 15:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/649933#M31189</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-22T15:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650032#M31200</link>
      <description>&lt;P&gt;With these data, the only way to get around it is to drop cov (for this model and data). I did some more playing around, which I'll explain here. You can see the impact of the confounding by focusing on the Type I tests, and putting cov and animnum as the first two variables in the model, that way you can focus better on the implications of the link between these two, ignoring everything else. If you use cov and animnum in that order, you get very reasonable results for Type I tests. cov is significant with F(1,19)=66.4 (slope = 0.6), and animnum is significant with F(6,19)=4.13. The continuous cov variable provides some information on the response, but not all of the information since cov is capturing just the linear effect. Any nonlinear effect is left over, which is then captured by the animnum factor. I think the df_N is 6 and not 7 because some of the effect of animnum factor is already captured by cov (one more level is 0 in the solution).&lt;/P&gt;
&lt;P&gt;Now, if you put animnum and cov as the first two variables (in that order), things are very different. animnum is significant with F(7,19)=13.03, but cov has no effect, with F(0,.)=missing (slope = 0). The entire effect of animnum/cov is already captured by the first term in the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can even look at this in a different way, although this is just for demonstration purposes. Define cov as a factor. Then fitting the model with cov factor (and no animnum) gives the exact same fit (same -2LL) as the model with animnum factor (an no cov factor). Trying to put both in the model as factors blows things up real good.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was interesting to think about all of this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 21:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650032#M31200</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2020-05-22T21:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650709#M31233</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13758"&gt;@lvm&lt;/a&gt;&amp;nbsp;.&amp;nbsp; The answer is somewhere above this, but I wanted to acknowledge the effort you put into this.&amp;nbsp; As you pointed out, cov is completely confounded with animnum, and as a result, when the model presented was used, things fell apart.&amp;nbsp; So there were two possible outs, either get rid of the pretreatment covariate or change the model.&amp;nbsp; Since we adjust for the pretreatment value with other designs, including a non-replicated Latin square, the optimum path was to change the model to an appropriate form for a whole plot Latin square with a split-plot in time.&amp;nbsp; As I mention, that design is spelled out explicitly in SAS for Mixed Models, and we are in the process of incorporating it in place of the code that was giving us fits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 12:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650709#M31233</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-26T12:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650921#M31255</link>
      <description>&lt;P&gt;I know you found a different model that will work. I just thought I would share with other interested readers the things you can learn from Type 1 testing, since Type 1 testing is not done often enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 21:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/650921#M31255</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2020-05-26T21:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: GLIMMIX oddity - df and solution dependent on location of term in the MODEL statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/651064#M31263</link>
      <description>&lt;P&gt;That is a great point&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13758"&gt;@lvm&lt;/a&gt;&amp;nbsp;. I think it is one of the main reasons Frank Harrell left SAS for other software.&amp;nbsp; I really appreciate you and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/330163"&gt;@STAT_Kathleen&lt;/a&gt;&amp;nbsp; going through everything and pointing out what happens with complex designs. And&amp;nbsp; also want to acknowledge Milliken and Johnson's Analysis of Messy Data, vol.3 Analysis of Covariance for additional thoughts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 12:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GLIMMIX-oddity-df-and-solution-dependent-on-location-of-term-in/m-p/651064#M31263</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-27T12:33:11Z</dc:date>
    </item>
  </channel>
</rss>

