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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 12177 views
  • 0 likes
  • 3 in conversation