BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lauragrau
Calcite | Level 5

Hello,

 

I raw this model:

 

proc mixed data=grouping ;
class id b;
model y=time|b/outpred=Pred;
random intercept /sub=id type=un;
store out=MixedModel;
lsmeans b/ at time=(0) diff;
lsmeans b/ at time=(3) diff;
run;

 

I can use PROC PLM to visualize the effectplot:

proc plm restore=MixedModel;
effectplot fit(x=time plotby=b)/clm; 
effectplot slicefit(x=time sliceby=b)/clm;
run;

 

Two questions:

1) Is there a way to change how PROC PLM's visuals look? I want to change the formatting!

 

 

I also tried this

proc sgplot data=pred;
band x=timelower=lower upper=upper/group=b transparency=.75;
series x=time y=pred/group=b;
run;

 

However, this graph looks different than the PLM graph.

 

T

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

There are two kinds of predicted values. The OUTPRED= option outputs the predicted that incorporate the random intercept estimates for each subject. The OUTPREDM= option outputs the marginal (averaged) predictions. These are the same predicted values that you obtain from the STORE statement and PROC PLM. 

 

So if you want to get the PROC PLM graph, use OUTPREDM=.

 

For details, an example, and more explanation, see "Visualize a mixed model that has repeated measures or random coefficients," especially the last section.

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Show us the plots. Describe what you don't like. Provide screen captures by clicking on the "Insert Photos" and not by attachments.

--
Paige Miller
lauragrau
Calcite | Level 5
Unfortunately, I can't! It's protected data. Basically, there are only two time points. PROC PLM makes a super nice graph with two lines, clearly showing the interaction. The SGPLOT has vertical lines at 0 and 3, which are then connected.
Rick_SAS
SAS Super FREQ

There are two kinds of predicted values. The OUTPRED= option outputs the predicted that incorporate the random intercept estimates for each subject. The OUTPREDM= option outputs the marginal (averaged) predictions. These are the same predicted values that you obtain from the STORE statement and PROC PLM. 

 

So if you want to get the PROC PLM graph, use OUTPREDM=.

 

For details, an example, and more explanation, see "Visualize a mixed model that has repeated measures or random coefficients," especially the last section.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 3 replies
  • 1348 views
  • 0 likes
  • 3 in conversation