The SAS Output Delivery System and reporting techniques

Saving Residuals in Proc Mixed

Reply
N/A
Posts: 0

Saving Residuals in Proc Mixed

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
Contributor
Posts: 20

Re: Saving Residuals in Proc Mixed

Posted in reply to deleted_user
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;
N/A
Posts: 0

Re: Saving Residuals in Proc Mixed

It works! Thanks a lot!

sliu
Ask a Question
Discussion stats
  • 2 replies
  • 2586 views
  • 0 likes
  • 2 in conversation