How do I compare 2 mixed models with different fixed Effects (here "B"). I understand I cannot use REML but want to know if model B fits the data better than model A. On the internet I saw something about using ANOVA for a Chi-square analysis in R, but don't know how to do it in SAS. I'm a SAS newbie. Thanks.
proc mixed data=ttnc_subsetsort PLOTS=RESIDUALPANEL(UNPACK) RATIO;
class hyb ntrt pd loc pass rep;
model tnc =hyb ntrt pd ntrt*hyb pd*hyb ntrt*pd / residual;
random loc rep(loc) loc*ntrt loc*hyb ;
lsmeans hyb ntrt pd hyb*ntrt / pdiff=all cl adjust=tukey alpha=0.10;
title1 'Fit Model A with Factors';
store modA;
run;
proc mixed data=ttnc_subsetsort PLOTS=RESIDUALPANEL(UNPACK) RATIO;
class hyb ntrt pd loc pass rep;
model tnc =hyb ntrt pd ntrt*hyb pd*hyb ntrt*pd B / residual;
random loc rep(loc) loc*ntrt loc*hyb ;
lsmeans hyb ntrt pd hyb*ntrt / pdiff=all cl adjust=tukey alpha=0.10;
title1 'Fit Model B with Factors';
store modB;
run;
Since the base model is nested within model B, you can get a likelihood ratio test for the significance of adding the B parameter by subtracting the -2 log likelihood for the base model from the same factor of model B. This should give the same probability as the F test for B in the B model.
But somehow, I don't think this is quite what you are looking for. I suspect you want to know something about the adequacy of the full models. This is where information criteria are helpful. In this case, as there are a fairly substantial number of parameters, I would suggest looking at the corrected AIC values for the two models, and selecting the one with the smaller value. See Burnham, K. P.; Anderson, D. R. (2002), Model Selection and Multimodel Inference: A practical information-theoretic approach (2nd ed.), Springer-Verlag., or for a quick overview, look at the Wikipedia article here.
SteveDenham
Since the base model is nested within model B, you can get a likelihood ratio test for the significance of adding the B parameter by subtracting the -2 log likelihood for the base model from the same factor of model B. This should give the same probability as the F test for B in the B model.
But somehow, I don't think this is quite what you are looking for. I suspect you want to know something about the adequacy of the full models. This is where information criteria are helpful. In this case, as there are a fairly substantial number of parameters, I would suggest looking at the corrected AIC values for the two models, and selecting the one with the smaller value. See Burnham, K. P.; Anderson, D. R. (2002), Model Selection and Multimodel Inference: A practical information-theoretic approach (2nd ed.), Springer-Verlag., or for a quick overview, look at the Wikipedia article here.
SteveDenham
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.