Generating Empirical Bayses estimates in PROC MIXED


No cake for spunky
I have found various suggestions this be done, it shrinks estimates to the grand mean based on reliability. But I can not find anywhere in the SAS documentation how to request these.


Less is more. Stay pure. Stay poor.
I did this once, I wont be in office until Monday. I think you likely add just an option word. If i recall empirical bayes just uses the mean as the prior.


No cake for spunky
I think you do the code SOLUTION which I just found.

Do you know a simple way to do the chi square test for two different deviance results in SAS. The code is probably simple. I know you run the model, it has to be nested, once then the more complex model, save the two deviance values and then run a chi square.

For testing slopes I am not sure what the DF is. If you are testing through a chi square test if making a slope random is accurate, how do you know in SAS what the DF is.
Last edited:


Less is more. Stay pure. Stay poor.
I know I am the best. This is the code I had saved, so not exactly what your looking for. Please provide a link to what you found.


/* Bayesian: Jeffrey's Priors on Variance and Flat priors on fixed effects */

/* Resources:

SEE SAS Inc. MLM Book PDF Ch. 13

Paper: Nonconjugate Bayesian Analysis of Variance Component Model, 2000 Biometrics.



ods graphics on;

proc mixed data=complete_step covtest cl method=reml asycov;

class MRN;

model FEV1 = Recovery_Time_20




BMI_calc/ s residual influence cl;

random int age_5 /  subject=MRN s;

prior / nsample=1e4 seed=1234 out=post psearch ptrans;


ods graphics off;


Active Member
i think you can also get them using 'outp=' in the model statement (as opposed to 'outpm' which gives only fixed effects).