Programming the statistical procedures from SAS

plotting residuals in proc mixed for big dataset

Reply
Occasional Contributor
Posts: 7

plotting residuals in proc mixed for big dataset

[ Edited ]

hi there

 

I am trying to plot rresiduals in proc mixed for fixed and random effect for a big data but I do not know how.

Can anybody give me some example and different was for plooting residuals in proc mixed please?

 

regards,

Farg

SAS Employee
Posts: 19

Re: plotting residuals in proc mixed for big dataset

 

To get residuals in PROC MIXED for a large data set, you need to add the RESIDUAL option to the model statement. This requests plots of both conditional and marginal residuals. However, ODS supresses plots with more than 5000 points by default. To remove this restriction, add plot(maxpoints=none) to the PROC MIXED statement. Here's an example:

 

proc mixed data=mydata plots(maxpoints=none);

class id;

model y = x / ddfm=kr2 residual;

random int / subject=id;

run;

 

On a side note, I recommend that you also plot the predicted values for the random effects (the EBLUPS). Like the residuals, the random effects are assumed to be normally distributed and unrelated to the predictors. You can request EBLUPS with the SOLUTION option on the RANDOM statement, and then output them with an ODS OUTPUT statement. Here's an example:

 

proc mixed data=mydata plots(maxpoints=none);

class id;

model y = x / ddfm=kr2 residual;

random int / subject=id solution;

ods output solutionr=randomeffects;

run;

 

The data set of EBLUPS can then be combined with your original data for graphing. 

 

Ask a Question
Discussion stats
  • 1 reply
  • 107 views
  • 0 likes
  • 2 in conversation