Help using Base SAS procedures

Non-positive definite G matrix in proc mixed (3-level HLM model)

Reply
N/A
Posts: 0

Non-positive definite G matrix in proc mixed (3-level HLM model)

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.
Respected Advisor
Posts: 2,655

Re: Non-positive definite G matrix in proc mixed (3-level HLM model)

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
Respected Advisor
Posts: 2,655

Re: Non-positive definite G matrix in proc mixed (3-level HLM model)

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
N/A
Posts: 0

Re: Non-positive definite G matrix in proc mixed (3-level HLM model)

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......
Ask a Question
Discussion stats
  • 3 replies
  • 145 views
  • 0 likes
  • 2 in conversation