Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Non-positive definite G matrix in proc mixed (3-le...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-05-2010 08:46 PM

Hi there,

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.

So this is what my model looks like in SAS:

proc mixed data=data covtest nobound;

class patientid hospital trt sex;

model outcome=time trt time*trt sex age/solution;

random intercept time/ type=UN sub=hospital;

random intercept time/ type=UN sub=patientid(hospital);

run;

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.

Any suggestions would be greatly appreciated it. Thank you very much.

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.

So this is what my model looks like in SAS:

proc mixed data=data covtest nobound;

class patientid hospital trt sex;

model outcome=time trt time*trt sex age/solution;

random intercept time/ type=UN sub=hospital;

random intercept time/ type=UN sub=patientid(hospital);

run;

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.

Any suggestions would be greatly appreciated it. Thank you very much.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-06-2010 08:37 AM

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?

Steve Denham

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-06-2010 08:41 AM

More:

Perhaps the following will give what you are looking for:

proc mixed data=data covtest nobound;

class patientid hospital trt sex;

model outcome=time trt time*trt sex age/solution;

random hospital:

random intercept time/ type=UN sub=patientid(hospital);

run;

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.

Steve Denham

Perhaps the following will give what you are looking for:

proc mixed data=data covtest nobound;

class patientid hospital trt sex;

model outcome=time trt time*trt sex age/solution;

random hospital:

random intercept time/ type=UN sub=patientid(hospital);

run;

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.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-06-2010 08:08 PM

Hi Steve,

Thanks for your comment. I've tried running the code you suggested but I'm still getting the slope variance to be negative......

Thanks for your comment. I've tried running the code you suggested but I'm still getting the slope variance to be negative......