I'm performing an ANOVA with Dunnett's t-test to simultaneously compare three groups against a control group. I get an overall F-statistic and p-value as well as confidence limits for each of the pairwise differences, but I really want p-values for each of these pairwise comparisons. I set ODS TRACE ON to see the data sets produced by the ANOVA procedure, but it doesn't look like any of them have pairwise p-values. Is there a way to get these? Here's my code:
ods output CLDiffs=week_13_da_stats;
ods output OverallANOVA=week_13_da_anova;
proc anova data=week_13_temp2;
class group;
model pg_DA_ug_Protein=group;
means group / dunnett("Control") nosort;
title "ANOVA: Week 13 DA";
run;
quit;
If your data is balanced, or nearly balanced, you can ask for lsmeans with option pdiff=control('CONTROL VALUE') in proc glm. If your data isn't balanced, you might be better with lsmeans anyway, depending on your inference needs. Example (adapted from SAS doc.):
title1 'Nitrogen Content of Red Clover Plants';
data Clover;
input Strain $ Nitrogen @@;
datalines;
3DOK1 19.4 3DOK1 32.6 3DOK1 27.0 3DOK1 32.1 3DOK1 33.0
3DOK5 17.7 3DOK5 24.8 3DOK5 27.9 3DOK5 25.2 3DOK5 24.3
3DOK4 17.0 3DOK4 19.4 3DOK4 9.1 3DOK4 11.9 3DOK4 15.8
3DOK7 20.7 3DOK7 21.0 3DOK7 20.5 3DOK7 18.8 3DOK7 18.6
3DOK13 14.3 3DOK13 14.4 3DOK13 11.8 3DOK13 11.6 3DOK13 14.2
COMPOS 17.3 COMPOS 19.4 COMPOS 19.1 COMPOS 16.9 COMPOS 20.8
;
proc glm data=Clover;
class Strain;
model Nitrogen = Strain;
lsmeans Strain / pdiff=control('COMPOS');
run;
Try PROC MULTTEST?
If your data is balanced, or nearly balanced, you can ask for lsmeans with option pdiff=control('CONTROL VALUE') in proc glm. If your data isn't balanced, you might be better with lsmeans anyway, depending on your inference needs. Example (adapted from SAS doc.):
title1 'Nitrogen Content of Red Clover Plants';
data Clover;
input Strain $ Nitrogen @@;
datalines;
3DOK1 19.4 3DOK1 32.6 3DOK1 27.0 3DOK1 32.1 3DOK1 33.0
3DOK5 17.7 3DOK5 24.8 3DOK5 27.9 3DOK5 25.2 3DOK5 24.3
3DOK4 17.0 3DOK4 19.4 3DOK4 9.1 3DOK4 11.9 3DOK4 15.8
3DOK7 20.7 3DOK7 21.0 3DOK7 20.5 3DOK7 18.8 3DOK7 18.6
3DOK13 14.3 3DOK13 14.4 3DOK13 11.8 3DOK13 11.6 3DOK13 14.2
COMPOS 17.3 COMPOS 19.4 COMPOS 19.1 COMPOS 16.9 COMPOS 20.8
;
proc glm data=Clover;
class Strain;
model Nitrogen = Strain;
lsmeans Strain / pdiff=control('COMPOS');
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.