BookmarkSubscribeRSS Feed
TamaraTavares
Calcite | Level 5

Hello,

 

I used proc mixed command to conduct linear mixed models to examine whether genetic status (mutation carrier vs. non-mutation carrier) is associated with increased ventricular volume (continous variable). I found a main effect of genetic status and another predictor variable (years to onset) and I am interested in plotting my data & the model in order to visualize it.  

 

I have ran the following to create a graph:


proc plm source=graph6;
title plot Genetic Status*Years From Symptom Onset; effectplot slicefit (x=YrsfromAV_AAO_Time1 sliceby=GS_Time1);
run;

 

I was wondering if anyone knows of a way to create this line graph that encompasses the model, in addition to a scatter plot indicating each data point overlaid on it.

 

Thank you in advance,

Tamara

1 REPLY 1
Rick_SAS
SAS Super FREQ

The "item store" that PROC PLM reads does not contain observation information, just a summary of the model. So you can't overlay the fit on a scatter plot with PROC PLM. However, you can use the OUTPUT statement to save out the predictions and then use PROC SGPLOT to visualize the model. See the example code in 

https://communities.sas.com/t5/SAS-Statistical-Procedures/How-to-plot-regression-line-from-mixed-mod...

 

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
  • 1 reply
  • 2006 views
  • 0 likes
  • 2 in conversation