A SAS user on reddit asks this question. No responses there so far, but I'll bet someone here can comment with a clever explanation. We can close the loop when we have an answer.
Hi there,
as far as I know SAS does not allow for an effect to be fixed if it is nested within an effect set as random. An example model would be
y = A + A∙B + e
with A random and A∙B fixed.
Can anyone confirm this for me or is there a way to work around it? I'm fine with it not being possible, I just wanted to check if I missed something. I'd like to write in my article that it is not possible.
Thanks
You are right. If one effect is random, then it's interaction must be random. The opposite is not true: A and B can both be fixed effects, but A*B can be random. The latter happens a lot, and it a common situation with multi-treatment meta-analysis.
You can force MIXED to do what you want by creating other variables in a DATA step (AA=A; BB=B), and then define some of these as random in in MIXED. I don't recommend this: you could get strange or meaningless results.
You are right. If one effect is random, then it's interaction must be random. The opposite is not true: A and B can both be fixed effects, but A*B can be random. The latter happens a lot, and it a common situation with multi-treatment meta-analysis.
You can force MIXED to do what you want by creating other variables in a DATA step (AA=A; BB=B), and then define some of these as random in in MIXED. I don't recommend this: you could get strange or meaningless results.
But @lvm, isn't it misleading to say "SAS does not allow for an effect to be fixed if it is nested within an effect set as random"?
Is it "SAS" that prevents it, or is it the theory of mixed models that prevents it, and SAS merely adheres to the theory?
Rick, I agree that SAS does not allow it for a reason: statistical theory. My latter suggestion was just to see what happens. It is not a limitation of MIXED: one should consider interactions as random when any of the component main effects are random.
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.