Hi,
I run a mixed model for a repeated mesures analysis. I have 2 factors : group factor with 4 levels and week factor with 5 levels. I want to test the time effect in each group and the group effect in each week.
I used the following code to test time effect in group 1 and group effect in week 2 :
run;
It is working for "Time effect in group 1" but it does not work for "Group effect at time 2".
In the log, I can see " the contrast is not estimable".
Please, can you let me know if my first contrast is correct and if so, why the second one does not work?
Many thanks
Matthieu
Contrast statements are difficult for me (and others) to write, and there is a much simpler tool. Please look at the SLICE statement, it will estimate the values you want in this case. SAS has done the hard job of coming up with the right Contrasts (behind the scenes) so you don't have to do it yourself.
I agree with @PaigeMiller -- the SLICE statement is much easier to use. For example --
Thank you very much,
I tried both, slice statement and revised contrast statement as you suggested.
It is working perfectly.
Thanks again
Regards,Matthieu
Thank you,
Slice statement is much simpler !
From your CONTRAST statement,
You want "Time effect5 - Time effect1
in group 1" , NOT "Time effect in group 1" .
If you want Time5 v.s. Time1 effect, I think the best way is using LSMESTIMATE:
lsmestimate group*week 'time5- time1 at group1' -1 0 0 0 1 ;
Hi,
Thanks for your the suggested statements. It helps me too to compare groups two by two.
Matthieu
Advice: only use CONTRAST statements when the coefficients in the contrast statement are not some combination of -1 or 0 or 1. For example, if you want coefficients 2 -5 3, then CONTRAST is probably the way to go. Otherwise use SLICE or LSMEANS.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.