BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I am using proc mixed to analyse multilevel data. For a simple example

data survey;
input group id money satisfaction;
datalines;
1 1 5 3
1 2 4 2
1 3 9 4
2 1 2 6
2 2 5 4
2 3 7 4
;

proc mixed data=survey covtest noclprint noitprint noinfo; class Group;
model satisfaction = money/ DDFM=bw solution CL; Random intercept/ sub=group;
run;

When I use ods listing to see what output I can get, there were only "covariance parameter estimates", "fit statistics", and "solution for fixed effects". However, I am interested in the residuals at both levels of analysis (group-level and individual-level).

How can I save those?

Thank you very much for your help!

sliu
3 REPLIES 3
sfleming
Calcite | Level 5
You can add options to get the residuals.

To the MODEL statement add the RESIDUAL and OUTP= options to create a SAS dataset with the residuals for each individual.

To the RANDOM statement add the SOLUTION option. This will print a table of the random effects for each group which you can capture with ODS. The ODS name for the table is SOLUTIONR

proc mixed data=survey covtest noclprint noitprint noinfo;
class Group;
model satisfaction = money/ DDFM=bw solution CL residual outp=predresid;
Random intercept/ sub=group solution;
run;
deleted_user
Not applicable
It works! Thanks a lot!

sliu
daaesteban
Calcite | Level 5

How can I view the residual table generated?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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