BookmarkSubscribeRSS Feed
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!


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


Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


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
  • 2 replies
  • 3 in conversation