Hi all, I know that we can use proc ttest in SAS to test the mean difference between two samples. But, if we have multiple pairwise samples and conduct multiple t-tests for each pairwise sample, how can we do a joint test for them? For example, suppose there are four samples 1-4, and the H0: the means of samples 1 and 2 are equal and the means of samples 3 and 4 are equal. How can I specify the paired samples instead of comparing all the randomly selected two samples?
Thank you very much for all your help! Do appreciate!
If you mean that you want a joint test comparing only two selected pairs of four means, then you can do that in many procedures with the LSMESTIMATE statement as follows. In a procedure (like PROC LOGISTIC) you might need to add the PARAM=GLM option in the CLASS statement. In procedures that don't directly support the LSMESTIMATE statement but do support the STORE statement (like PROC GLM), you will need to use the STORE statement to save the fitted model and then use the LSMESTIMATE statement in PROC PLM.
class group;
model y=group;
lsmestimate group '12' 1 -1 0 0, '34' 0 0 1 -1 / joint(label='12&34');
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.