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?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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