BookmarkSubscribeRSS Feed
xizidememeda
Calcite | Level 5

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!

2 REPLIES 2
StatDave
SAS Super FREQ

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');
Ksharp
Super User
You should resort to ANOVA by PROC GLM +LSMEANS.
Or check PROC MULTTEST on its second example for multiple t-tests.

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 591 views
  • 6 likes
  • 3 in conversation