<?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 Non-positive definite G matrix in proc mixed (3-level HLM model) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16645#M3096</link>
    <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
I have a 3-level growth model, where each patient has 3 waves of data recorded and the patients are nested within 6 hospitals. I should mention that my outcome is continuous. The patients were allocated to either of the two treatments available at each of the hospitals, and I am interested to see whether one treatment is better than another. I am assuming random intercepts and slopes as well as the unstructured covariance structure.&lt;BR /&gt;
So this is what my model looks like in SAS:&lt;BR /&gt;
&lt;BR /&gt;
proc mixed data=data covtest nobound;&lt;BR /&gt;
class patientid hospital trt sex;&lt;BR /&gt;
model outcome=time trt time*trt sex age/solution;&lt;BR /&gt;
random intercept time/  type=UN sub=hospital;&lt;BR /&gt;
random intercept time/  type=UN sub=patientid(hospital);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
My problem is that I keep getting a warning that the G matrix is non-positive definite. For the level 3 residuals I get negative variances for the intercepts and for the level 2 residuals I am getting both intercept and slope variances to be negative. I have tried FA(2) and some other covariance structures in the combination with 'parms' statement (which should also be ensuring that the G matrix is positive definite), but I still get the same problem. &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions would be greatly appreciated it. Thank you very much.</description>
    <pubDate>Thu, 06 May 2010 00:46:24 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-05-06T00:46:24Z</dc:date>
    <item>
      <title>Non-positive definite G matrix in proc mixed (3-level HLM model)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16645#M3096</link>
      <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
I have a 3-level growth model, where each patient has 3 waves of data recorded and the patients are nested within 6 hospitals. I should mention that my outcome is continuous. The patients were allocated to either of the two treatments available at each of the hospitals, and I am interested to see whether one treatment is better than another. I am assuming random intercepts and slopes as well as the unstructured covariance structure.&lt;BR /&gt;
So this is what my model looks like in SAS:&lt;BR /&gt;
&lt;BR /&gt;
proc mixed data=data covtest nobound;&lt;BR /&gt;
class patientid hospital trt sex;&lt;BR /&gt;
model outcome=time trt time*trt sex age/solution;&lt;BR /&gt;
random intercept time/  type=UN sub=hospital;&lt;BR /&gt;
random intercept time/  type=UN sub=patientid(hospital);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
My problem is that I keep getting a warning that the G matrix is non-positive definite. For the level 3 residuals I get negative variances for the intercepts and for the level 2 residuals I am getting both intercept and slope variances to be negative. I have tried FA(2) and some other covariance structures in the combination with 'parms' statement (which should also be ensuring that the G matrix is positive definite), but I still get the same problem. &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions would be greatly appreciated it. Thank you very much.</description>
      <pubDate>Thu, 06 May 2010 00:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16645#M3096</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-06T00:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Non-positive definite G matrix in proc mixed (3-level HLM model)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16646#M3097</link>
      <description>I believe the non-positive G is due to an overspecification of the random effects.  After the fit of the patientid within hospital covariance structure, there is no variability "left" for the hospital only structure--the G matrix is linearly dependent.  What occurs if you specify only patientid within hospital as a subject effect?&lt;BR /&gt;
&lt;BR /&gt;
Steve Denham</description>
      <pubDate>Thu, 06 May 2010 12:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16646#M3097</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2010-05-06T12:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Non-positive definite G matrix in proc mixed (3-level HLM model)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16647#M3098</link>
      <description>More:&lt;BR /&gt;
&lt;BR /&gt;
Perhaps the following will give what you are looking for:&lt;BR /&gt;
&lt;BR /&gt;
proc mixed data=data covtest nobound;&lt;BR /&gt;
class patientid hospital trt sex;&lt;BR /&gt;
model outcome=time trt time*trt sex age/solution;&lt;BR /&gt;
random hospital:&lt;BR /&gt;
random intercept time/ type=UN sub=patientid(hospital);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This would give a variance component due to hospitals, and would fit the random regression to the patients within each hospital.  However, I cannot guarantee that the linear dependency is removed.&lt;BR /&gt;
&lt;BR /&gt;
Steve Denham</description>
      <pubDate>Thu, 06 May 2010 12:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16647#M3098</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2010-05-06T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Non-positive definite G matrix in proc mixed (3-level HLM model)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16648#M3099</link>
      <description>Hi Steve,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your comment. I've tried running the code you suggested but I'm still getting the slope variance to be negative......</description>
      <pubDate>Fri, 07 May 2010 00:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Non-positive-definite-G-matrix-in-proc-mixed-3-level-HLM-model/m-p/16648#M3099</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-07T00:08:59Z</dc:date>
    </item>
  </channel>
</rss>

