- Thread starter noetsi
- Start date

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.

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:

Code:

```
/**************************************************************************/
/* Bayesian: Jeffrey's Priors on Variance and Flat priors on fixed effects */
/* Resources: https://communities.sas.com/t5/Statistical-Procedures/PRIOR-statement-in-mixed-procedure/td-p/246010
SEE SAS Inc. MLM Book PDF Ch. 13
Paper: Nonconjugate Bayesian Analysis of Variance Component Model, 2000 Biometrics.
/****************************************************************************/
/*FEV1*/
ods graphics on;
proc mixed data=complete_step covtest cl method=reml asycov;
class MRN;
model FEV1 = Recovery_Time_20
Max_HR_10
Min_Sat_5
Age_5
BMI_calc/ s residual influence cl;
random int age_5 / subject=MRN s;
prior / nsample=1e4 seed=1234 out=post psearch ptrans;
run;
ods graphics off;
```

https://education.illinois.edu/docs.../7_inference/random_effects-beamer-online.pdf