BookmarkSubscribeRSS Feed
Fluorite | Level 6



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));


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!


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.




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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