BookmarkSubscribeRSS Feed
twotwotwo
Calcite | Level 5

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!

7 REPLIES 7
art297
Opal | Level 21

Seeing the data might help someone trying to answer your question.

twotwotwo
Calcite | Level 5

Thanks for your response. Please see the attached.  I only put part of my data.  Thanks.

twotwotwo
Calcite | Level 5

Please see my attachment for the data.  Thanks!

Doc_Duke
Rhodochrosite | Level 12

I think that the problem is in your CLASS statement.  I think that it should read

CLASS group;

Doc Muhlbaier

Duke

twotwotwo
Calcite | Level 5

Thanks for your reply.  I really want CLASS name; How can I correct them? thanks!

Reeza
Super User

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.

twotwotwo
Calcite | Level 5

Thanks!  It then gave me three different p-value.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 7 replies
  • 1351 views
  • 0 likes
  • 4 in conversation