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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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