- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a question about plotting a figure for a mixed model. Time is a categorical variable, the outcome is a score, and the covariate is the site.
Here is my code:
PROC MIXED DATA = test METHOD = REML COVTEST ;
CLASS id site time_dichotomous_number(ref="1");
MODEL Score =time_dichotomous_number site time_dichotomous_number*site/ SOLUTION OUTPRED=PREDDATA;
RANDOM INTERCEPT / SUBJECT = record_id;
repeatedtime_dichotomous_number / type=ar(1) sub=id;
store out=MixedModel;
RUN;
proc plm restore=MixedModel;
effectplot interaction (x=site sliceby=time_dichotomous_number) / clm connect;
effectplot interaction (x=time_dichotomous_number sliceby=site) / clm connect;
run;
Regardless of how I label the categorical time variable, whether it's named 1-7, using letters (a, b, c, d...), or with a space before the letter, the figure consistently put time 1 at the end (Time 1 is the reference group when running the mixed model). Does anyone know how to position time 1 before time 2? Thanks!
Additionally, on the y-axis, it is labeled as "linear predictor." Is this the mean predicted value generated from the mixed model?
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
One way to get what you wanted is to run PROC MIXED twice. Once with the (ref="1") option in the CLASS statement so you get what you want for the parameter estimates, and no STORE statement is needed. Then you can run PROC MIXED the second time, with no (ref="1") option in the CLASS statement. Use the STORE statement this time. Then your PROC PLM output should display the time in the order as you wanted. To speed up the second PROC MIXED, you might add NOTEST option in the MODEL statement, also add NOINFO NOITPRINT NOCLPRINT options in the PROC MIXED statement.
Alternatively, you might define a format for your variable time_dichotomous_number, such that the format for "1" comes first alphabetically, and assign this format to the variable time_dichotomous_number.
Yes, the values being plotted are the predicated values from your PROC MIXED model.
Hope this helps,
Jill
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
One way to get what you wanted is to run PROC MIXED twice. Once with the (ref="1") option in the CLASS statement so you get what you want for the parameter estimates, and no STORE statement is needed. Then you can run PROC MIXED the second time, with no (ref="1") option in the CLASS statement. Use the STORE statement this time. Then your PROC PLM output should display the time in the order as you wanted. To speed up the second PROC MIXED, you might add NOTEST option in the MODEL statement, also add NOINFO NOITPRINT NOCLPRINT options in the PROC MIXED statement.
Alternatively, you might define a format for your variable time_dichotomous_number, such that the format for "1" comes first alphabetically, and assign this format to the variable time_dichotomous_number.
Yes, the values being plotted are the predicated values from your PROC MIXED model.
Hope this helps,
Jill
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Regarding the second method, could you provide more clarification? I tried to label the time categories as "1", "a", "b", "c", but "1" still appears after "c".