BookmarkSubscribeRSS Feed
farag
Calcite | Level 5

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

1 REPLY 1
StatsGeek
SAS Employee

 

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. 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 5432 views
  • 0 likes
  • 2 in conversation