- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am running into an issue with my mixed model, where the addition of the SOLUTION option in the random statement of PROC MIXED drastically affects the fixed effects estimates. Below is the model:
proc mixed data=eff method=REML;
by trtgrpn trtgrp;
class TRTPN (ref=first) USUBJID STRATAR;
model AVAL = TRTPN BASE avisitn TIMEK avisitn*TRTPN TIMEK*TRTPN STRATAR / solution ddfm=kr alpha=0.05 cl;
random INT avisitn TIMEK / sub=USUBJID type=un v;
estimate "Acute Slope, No Response" avisitn 52 avisitn*TRTPN 0 52 / e cl;
estimate "Acute Slope, Response" avisitn 52 avisitn*TRTPN 52 0/ e cl;
estimate "Chronic Slope, No Response" avisitn 52 TIMEK 52 avisitn*TRTPN 0 52 TIMEK*TRTPN 0 52 / e cl;
estimate "Chronic Slope, Response" avisitn 52 TIMEK 52 avisitn*TRTPN 52 0 TIMEK*TRTPN 52 0 / e cl;
estimate "Difference, Chronic Slope" avisitn*TRTPN 52 -52 TIMEK*TRTPN 52 -52 / e cl;
run;
In the above model, TRTPN reflects No response vs response, STRATAR reflects a 4 level stratification variable, AVISITN reflects the categorical visit (Week 6 to Week 108), BASE is the baseline value, and TIMEK is the time from change point (Week 6). TRTGRP/TRTGRPN reflects a subgroup of 2 different treatments. The results from this model are as follows:
If I include the S option in the RANDOM statement, the estimates/DF for TRTGRPN = 2 drastically change:
Any thoughts on why this might be occurring?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello, It would be helpful if you could include your log and complete output. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for your response. Below are the logs from the model with SOLUTION specified in the RANDOM statement and without:
Without:
With:
The logs appear identical. I attached PDFs of the output from each model. The results for TRTGRP = A are identical but are drastically different for TRTGRP = B.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I think you should firstly get rid of the following message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the log and output. Let's call your two BY conditions 1A and 2B. When you add the SOLUTION option on the RANDOM statement, I see in your output for 2B that the table "Covariance Parameter Estimates" stays the same, whereas the tables "Solutions for Fixed Effects" and "Estimates" change. It is puzzling that the estimates for the covariance parameters stay the same, but the estimates for fixed effects (which are functions of the covariance parms) change. Off hand, I don't know why adding the SOLUTION option on the RANDOM statement should change the model. Maybe the option changes the inverse matrix being used in estimates?
As @Ksharp mentioned, you do have numerical problems with your model that you should fix. Here is a blog with some more information about the note "Estimated G matrix is not positive definite": Convergence in mixed models: When the estimated G matrix is not positive definite - The DO Loop
You do want to do something about a non-positive definite G matrix and don't want to continue with results where that is an issue.
Some things you could try:
1) Remove one of AVISITN or TIMEK from the RANDOM statement. This reduces your covariance matrix to make it simpler. I vote for removing AVISITN, since it has a zero variance estimate in your 1A case.
2) Specify the NOBOUND option on the PROC MIXED statement to allow variance components to be allowed to be negative. I don't have a lot of experience with doing this.
3) Try forming your covariance structure with a REPEATED statement instead of a RANDOM statement. For example, you could try a spatial power covariance structure with TYPE=SP(POW)(TIMEK).
4) Run this model in PROC GLIMMIX instead of PROC MIXED. You'd need to remove the METHOD=REML option, but otherwise, I think your code should run without edits. I doubt that using GLIMMIX would do anything about your non-positive G matrix, but it might help with the fact that your output is changing when the SOLUTION option is added.
To really get to the bottom of this, I suggest you contact SAS tech support. Their help is included with your license:
SAS Technical Support | SAS Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am also curious. SOLUTION option of RANDOM statement is just printing out the mixed effect estimated coefficient, would not change its value .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Would you be willing to try an experiment that might help us diagnose the issue?
I would be very interested in knowing what happens if you use WHERE clauses instead of the BY statement. Could you try the following:
- Remove the BY statement.
- Add the following statement:
WHERE trtgrpn=1 AND trtgrp='A'; - On the RANDOM statement, remove the SOLUTION option.
- Change the ODS OUTPUT statement to be
ODS OUTPUT Estimates=Est_No_Soln; - Run the procedure.
- On the RANDOM statement, specify the SOLUTION option.
- Change the ODS OUTPUT statement to be
ODS OUTPUT Estimates=Est_Soln; - Run the procedure.
- Compare the Est_no_Soln and Est_Soln datasets.
If you get different results, please use PROC PRINT to show both datasets.
If you do not get different results, please run the other three cases that are handled by the BY statement:
- WHERE trtgrpn=1 AND trtgrp='B';
- WHERE trtgrpn=2 AND trtgrp='A';
- WHERE trtgrpn=2 AND trtgrp='B';
By getting rid of the BY statement, we can focus on the subset of the data that is causing the issue.