<?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 Problem with quadratic term in Proc Mixed in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20640#M4292</link>
    <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I am having problems fitting a quadratic term to a model in Proc Mixed. The following is my code (which exactly mimics the code given in Littell's SAS for Mixed Models book at the top of p. 196):&lt;BR /&gt;
&lt;BR /&gt;
proc mixed data=all_means_analysis noprofile;&lt;BR /&gt;
	title1 'Heterogeneous Autoregressive Mixed Model';&lt;BR /&gt;
	class treatment drought week pot;&lt;BR /&gt;
	model meanphoto = treatment drought week w w2 treatment*drought treatment*week treatment*w treatment*w2 treatment*drought*week treatment*drought*w treatment*drought*w2/htype=1;&lt;BR /&gt;
	repeated week / type=arh(1) sub=pot(treatment);&lt;BR /&gt;
	parms (1.2526) (1.2526) (1.4143) (1.3907) (1.9521) (1.4706) (1.3724) (1.2562) (1.2165) (0.7997) (0.6041) (0.7220) (0.3535) (1.1845) (0.5467) (1.1075) (1.7849) (1.2526) (1.1370) (0.02428) (0.6188) / noiter; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I am trying to look at photosynthetic rate over time, but it decreases over the growing season, so I think I need the quadratic term (w2 = week*week; w = week). But this is the output I get - without any error messages from the SAS system:&lt;BR /&gt;
&lt;BR /&gt;
 Type 3 Tests of Fixed Effects&lt;BR /&gt;
&lt;BR /&gt;
                                            Num     Den&lt;BR /&gt;
                   Effect                    DF      DF    F Value    Pr &amp;gt; F&lt;BR /&gt;
&lt;BR /&gt;
                   treatment                  2     117       2.36    0.0989&lt;BR /&gt;
                   drought                    1     117       0.31    0.5790&lt;BR /&gt;
                   week                      14     779      43.40    &amp;lt;.0001&lt;BR /&gt;
                   w                          0       .        .       .&lt;BR /&gt;
                   w2                         0       .        .       .&lt;BR /&gt;
                   treatment*drought          2     117       5.18    0.0070&lt;BR /&gt;
                   treatment*week            27     779       0.97    0.5074&lt;BR /&gt;
                   w*treatment                0       .        .       .&lt;BR /&gt;
                   w2*treatment               0       .        .       .&lt;BR /&gt;
                   treatme*drought*week      36     779      10.11    &amp;lt;.0001&lt;BR /&gt;
                   w*treatment*drought        0       .        .       .&lt;BR /&gt;
                   w2*treatment*drought       0       .        .       .&lt;BR /&gt;
 &lt;BR /&gt;
Is the model simply out of degrees of freedom? I have 123 samples, and when I remove some of the interactions from the model to free up some df, the model still will not fit any quadratic terms.&lt;BR /&gt;
&lt;BR /&gt;
Help?!&lt;BR /&gt;
&lt;BR /&gt;
Thanks!!!</description>
    <pubDate>Wed, 02 Mar 2011 19:14:45 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-03-02T19:14:45Z</dc:date>
    <item>
      <title>Problem with quadratic term in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20640#M4292</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I am having problems fitting a quadratic term to a model in Proc Mixed. The following is my code (which exactly mimics the code given in Littell's SAS for Mixed Models book at the top of p. 196):&lt;BR /&gt;
&lt;BR /&gt;
proc mixed data=all_means_analysis noprofile;&lt;BR /&gt;
	title1 'Heterogeneous Autoregressive Mixed Model';&lt;BR /&gt;
	class treatment drought week pot;&lt;BR /&gt;
	model meanphoto = treatment drought week w w2 treatment*drought treatment*week treatment*w treatment*w2 treatment*drought*week treatment*drought*w treatment*drought*w2/htype=1;&lt;BR /&gt;
	repeated week / type=arh(1) sub=pot(treatment);&lt;BR /&gt;
	parms (1.2526) (1.2526) (1.4143) (1.3907) (1.9521) (1.4706) (1.3724) (1.2562) (1.2165) (0.7997) (0.6041) (0.7220) (0.3535) (1.1845) (0.5467) (1.1075) (1.7849) (1.2526) (1.1370) (0.02428) (0.6188) / noiter; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I am trying to look at photosynthetic rate over time, but it decreases over the growing season, so I think I need the quadratic term (w2 = week*week; w = week). But this is the output I get - without any error messages from the SAS system:&lt;BR /&gt;
&lt;BR /&gt;
 Type 3 Tests of Fixed Effects&lt;BR /&gt;
&lt;BR /&gt;
                                            Num     Den&lt;BR /&gt;
                   Effect                    DF      DF    F Value    Pr &amp;gt; F&lt;BR /&gt;
&lt;BR /&gt;
                   treatment                  2     117       2.36    0.0989&lt;BR /&gt;
                   drought                    1     117       0.31    0.5790&lt;BR /&gt;
                   week                      14     779      43.40    &amp;lt;.0001&lt;BR /&gt;
                   w                          0       .        .       .&lt;BR /&gt;
                   w2                         0       .        .       .&lt;BR /&gt;
                   treatment*drought          2     117       5.18    0.0070&lt;BR /&gt;
                   treatment*week            27     779       0.97    0.5074&lt;BR /&gt;
                   w*treatment                0       .        .       .&lt;BR /&gt;
                   w2*treatment               0       .        .       .&lt;BR /&gt;
                   treatme*drought*week      36     779      10.11    &amp;lt;.0001&lt;BR /&gt;
                   w*treatment*drought        0       .        .       .&lt;BR /&gt;
                   w2*treatment*drought       0       .        .       .&lt;BR /&gt;
 &lt;BR /&gt;
Is the model simply out of degrees of freedom? I have 123 samples, and when I remove some of the interactions from the model to free up some df, the model still will not fit any quadratic terms.&lt;BR /&gt;
&lt;BR /&gt;
Help?!&lt;BR /&gt;
&lt;BR /&gt;
Thanks!!!</description>
      <pubDate>Wed, 02 Mar 2011 19:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20640#M4292</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-02T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with quadratic term in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20641#M4293</link>
      <description>The problem is that the covariates are completely confounded with week, so that there are no df available for testing their effect.&lt;BR /&gt;
&lt;BR /&gt;
I would suggest the following:&lt;BR /&gt;
&lt;BR /&gt;
A.  Eliminate week as a class variable.  Not so good if there truly is heterogeneity in the response by week (implied by the arh(1) covariate structure).&lt;BR /&gt;
&lt;BR /&gt;
B. Attack the linear and quadratic trends by using an ESTIMATE,  CONTRAST or LSMESTIMATE statement.  While this could get somewhat complicated, it is the best I can think of.  Having week as a class variable does not preclude it having some polynomial effect, and this could extract that effect efficiently.&lt;BR /&gt;
&lt;BR /&gt;
Also, you might get some additional responses if you posted in the Statistical Procedures forum.&lt;BR /&gt;
&lt;BR /&gt;
SteveDenham</description>
      <pubDate>Thu, 03 Mar 2011 12:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20641#M4293</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2011-03-03T12:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with quadratic term in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20642#M4294</link>
      <description>Hi Steve,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply! I removed week as a class variable, however, that causes a new problem. For the repeated statement, the repeated factor must be a class variable. So, now when I run the model, I get the following error message:&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Only class variables allowed in this effect.&lt;BR /&gt;
&lt;BR /&gt;
So, eliminating week doesn't seem to solve the problem... Plus, in the SAS for Mixed Models, they use hour, h, and h2 in the model statement with hour as a class variable and it seems to work. &lt;BR /&gt;
&lt;BR /&gt;
I will try the ESTIMATE, CONTRAST, LSMESTIMATE statements... maybe that will work....&lt;BR /&gt;
&lt;BR /&gt;
Any other ideas? I have also posted now to the SAS statistical procedures - thanks for the tip!</description>
      <pubDate>Thu, 03 Mar 2011 14:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20642#M4294</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-03T14:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with quadratic term in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20643#M4295</link>
      <description>Hi Steve,&lt;BR /&gt;
&lt;BR /&gt;
I think I may have found the solution: Keeping week as a class variable, using it in the REPEATED statement, but removing it from the model and using only w and w2, seems to work.&lt;BR /&gt;
&lt;BR /&gt;
Now, I just need to decide if keeping the quadratic term in the model is appropriate...&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your suggestions!</description>
      <pubDate>Thu, 03 Mar 2011 15:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-quadratic-term-in-Proc-Mixed/m-p/20643#M4295</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-03T15:37:31Z</dc:date>
    </item>
  </channel>
</rss>

