BookmarkSubscribeRSS Feed
gjenkins3
Fluorite | Level 6

Hello,

 

I'm trying to plot output from a 2-level MLM analysis. I've used ODS to save the output parameters, but have no idea how to make a coherent plot from this that will show differences in growth. I would like to examine the differences in both slope and intercept for craving (variable is TD_Craving) over time for individuals at three levels of negative affect (TD_NA).

 

I am using SAS University Edition and the code that I'm using for the model is:

 

proc mixed covtest data = twelveday method=ml;
class subject_id gender2;
model TD_craving = day age gender2 TD_NA / solution ddfm = betwithin;
random intercept day /sub=subject_id type=vc solution;
ods output solutionf=sf(rename=(estimate=overall));
ods output solutionr=sr(rename=(estimate=ssdev));
run;

 

I've attempted both proc sgplot and proc plm with no success (though this just means I probably am not using it correctly).

 

Does anybody have recommendations as to how to plot slopes and intercepts for individuals at varying levels of a trait such as negative affect? Do I need to assign each person to a high/low/medium level of TD_NA and then include that in the class statement?

 

Many Thanks!

1 REPLY 1
Rick_SAS
SAS Super FREQ

After you STORE the model into an item store, you can use the EFFECTPLOT statement in PROC PLM to visualize the predicted values for the model. (For procedures that do not support the STORE statement, you can create an effect plot manually.)

 

You can also use the OUTPREDM= option on the MODEL statement to output the predicted means yourself.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1511 views
  • 1 like
  • 2 in conversation