BookmarkSubscribeRSS Feed
GiaLee
Obsidian | Level 7

Hi all,

I have a question on creating a figure using linear mixed model results. The time variable is categorical, and the outcome is a score. My mentor asked me to draw one line in an unadjusted model and then draw one line while adjusting for several covariates. I can easily create the first figure using proc plm (figure 1). However, when I include covariates in the model and use proc plm, it automatically plots the figure and just adjust for effects with the variable after the "time" variable. Could someone assist me with this? Thank you!

 

 

unadjusted 

GiaLee_0-1709785664760.png

 

PROC MIXED DATA = a   METHOD = REML COVTEST;
CLASS record_id   time(ref="6")   younger   gender education;
MODEL Score = time   younger gender  education/ SOLUTION OUTpred=PREDDATA;
RANDOM INTERCEPT / SUBJECT = record_id;
repeated time_ / type=ar(1) sub=record_id;
store out=MixedModel;
RUN;
proc plm restore=MixedModel;
effectplot interaction (x=time_);
run;

 

adjusted 

Screen Shot 2024-03-06 at 23.34.38.png

 

2 REPLIES 2
GiaLee
Obsidian | Level 7
Thanks for the reply. These blogs are really helpful for plotting interaction terms. However, I'm looking for a way to plot the figure between time (category) and score, adjusting for several covariates but not the interaction terms. Thanks.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 241 views
  • 0 likes
  • 2 in conversation