Hi,
I performed a mixed model procedure and in this procedure, I used group as the fixed effect. The group is a categorical variable and has 4 level. And I want to compare the difference between each group with the contrast statement. Here is my code:
proc mixed data=test;
by brand;
class name;
model price=group;
contrast 'group1 vs2' group 1 -1 0 0;
contrast 'group1 vs3' group 1 0 -1 0;
contrast 'group1 vs4' group 1 0 0 -1;
run;
However, I got 3 SAME contrast p-value. But those 4 groups are different from each other. Why I got the same p-value for those 3 comparisons? Thanks!
Seeing the data might help someone trying to answer your question.
Thanks for your response. Please see the attached. I only put part of my data. Thanks.
Please see my attachment for the data. Thanks!
I think that the problem is in your CLASS statement. I think that it should read
CLASS group;
Doc Muhlbaier
Duke
Thanks for your reply. I really want CLASS name; How can I correct them? thanks!
SAS isn't considering GROUP a categorical variable if its not in the class statement.
You might want to include in your BY statement perhaps, ie a separate model for each value of name? or you can have both in the class statement.
CLASS group name;
Not sure, depends on what you're trying to do.
Thanks! It then gave me three different p-value.
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 16. 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.