Dear all,
I am feeling confused about reporting the results from a mixed model. The time is categorical (with "6" set as the reference). I tested the interaction between time and overweight, adjusted for several covariates, with the outcome being a score.
Here are the results from PROC mixed output and the PROC PLM output.
For instance, the estimate on time_*overweight at time "12" is -0.3755.
Does this mean that at time "12", the difference in score changes between time "6" and time "12" for the overweight group is significantly different from the difference in the non-overweight group? The overweight group has a mean score 0.3755 points lower than the non-overweight group at time "12"? This description is a little bit confusing, but am I understanding it correctly?
Regarding the PROC PLM output, is "Y" the predicted mean at each point across different groups?
And how could I explain this figure (significant or non significant..)? Could I explain this based on the "solution for fixed effects" table?
Thank you for your help.
@GiaLee The best way to get a complete answer is to post the SAS code that you are using. Otherwise, we can only guess what might be happening.
The OP posted essentially the same question as a comment to my blog. I responded, "The documentation for the EFFECTPLOT statement states that the covariates that are not in the plot are evaluated at a default value. For continuous covariates, the default is to use the mean. For a CLASS variable, the reference level is used. In the resulting plot, the Y axis is the predicted values of the model evaluated at the covariates."
You can use the AT option to set values if you do not want the default values.
For mixed models, there are two common "predicted values." See <a href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html">"Visualize a mixed model that has repeated measures or random coefficients"</a> for a discussion. PROC PLM uses the OUTPREDM= values, which is from the marginal model that does not incorporate the random effects. To incorporate the random slope or intercept for each subject, use the OUTPRED= values.
@GiaLee The best way to get a complete answer is to post the SAS code that you are using. Otherwise, we can only guess what might be happening.
The OP posted essentially the same question as a comment to my blog. I responded, "The documentation for the EFFECTPLOT statement states that the covariates that are not in the plot are evaluated at a default value. For continuous covariates, the default is to use the mean. For a CLASS variable, the reference level is used. In the resulting plot, the Y axis is the predicted values of the model evaluated at the covariates."
You can use the AT option to set values if you do not want the default values.
For mixed models, there are two common "predicted values." See <a href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html">"Visualize a mixed model that has repeated measures or random coefficients"</a> for a discussion. PROC PLM uses the OUTPREDM= values, which is from the marginal model that does not incorporate the random effects. To incorporate the random slope or intercept for each subject, use the OUTPRED= values.
Hi Rick, thanks for your reply.
I saw this sentence from your blog: "You can use the STORE statement and PROC PLM to obtain a graph of the predictions from the "marginal model" that contains the fixed effects. (You can also use the OUTPREDM= option for this purpose.)"
So I presume that I can use the predicted values in the OUTPREDM output data to generate a plot similar to what PROC PLM does. But I don't know how to do this. I attempted using PROC MEANS for the predicted values, but the results did not match.
Here is my code:
PROC MIXED DATA = test METHOD = REML COVTEST;
CLASS record_id younger (ref="0") time_(ref="6") female(ref="0") white (ref="0")
hispanic_(ref="0") depression_(ref="0") anxiety_(ref="0")
diabetes_(ref="0") hypertension_(ref="0") site_JL(ref="outpatien") vaccine(ref="0") overweight(ref="0")
other_comorbid(ref="0") fatigue_JL(ref="0");
MODEL Score = time_ overweight overweight*time_ younger female white
hispanic_ depression_ anxiety_
diabetes_ hypertension_ site_JL vaccine other_comorbid fatigue_JL/ SOLUTION OUTPREDM=PREDDATA S;
RANDOM INTERCEPT / SUBJECT = record_id;
repeated time_ / type=ar(1) sub=record_id;
LSMEANS time_ overweight overweight*time_/pdiff;
RUN;
proc plm restore=MixedModel;
effectplot interaction (x=time_ sliceby=overweight) / clm connect; run;
proc means data=PREDDATA; var pred; class time_ overweight; run;
Results: Here, we that for group 0, at time "6", it starts from -0.2, then increases to around 0.05, and finally returns to approximately -0.1. The Y-axis is the predicted mean I think.
Here are the mean prediction values at each time. We see that the mean value differs from the figure above.
PROC MEANS is reporting the unconditional predicted values. You are averaging over all observations, which include non-reference values of the covariate that are not shown in the plot. You need to construct a scoring data set that sets all values of the covariates to their reference (or mean) values, and then let TIME_ range over the range 6, 12, ..., 40. Then score the model on that data.
For an example, see the article, "How to create a sliced fit plot in SAS"
and especially the example that shows how to create a scoring data set in the section "Create a sliced fit plot manually."
Thank you Rick. This is very helpful.
By the way, may I ask you another question? Is there any relationship between the PROC PLM effectplot figure and the Least Squares Means estimates?
I plotted a figure using the values from the least squares means (generated from: LSMEANS time_ overweight overweight*time_/pdiff;)
We can see that the trajectory is parallel to what PROC PLM shows. However, once again, the values are slightly different.
The LS-means estimates are not the same as the predicted values from the model. The documentation of the LSMEANS statement explains the idea of LS-means:
The graph from PROC PLM shows the lsmeans when the values for other effects are at zero, as shown in the footnote of the plot; the graph from LSMEANS shows the lsmeans when the values for other related effects are at their means. You can add the E option in the LSMEANS statement to see exactly how the lsmeans correspond to.
Hope this helps,
Jill
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.