BookmarkSubscribeRSS Feed
gtucke1
Fluorite | Level 6

I want to run two-tailed t-tests using the following code:

Title "Age and Dementia Education";
Proc ttest data = X sides = 2 alpha = 0.05 h0=0;
Class h1_unmet;
Var cg_age;
Run;

Is this the correct code?

 

I've seen both two-tailed t-test and two sample t-tests mentioned. Are they different? I yes, what is the difference. 

2 REPLIES 2
PGStats
Opal | Level 21

If h1_unmet takes two values, the statement Class h1_unmet; defines two samples. The option sides=2 requests a two-sided test, i.e. the cg_age difference will be significant if it falls on the extreme left tail or the extreme right tail of the T distribution.

PG
PaigeMiller
Diamond | Level 26

If you have a data set and you want to compare the mean to a specific value (usually zero, but other values are possible), this is a one sample t-test. The hypothesis you are testing is H0: Mean = k

 

If the data set has two groups (such as male and female), and you want to compare the mean of group 1 to the mean of group two, this is a two sample t-test. The hypothesis you are testing is H0: Mean 1 = Mean 2

 

Both of the above are two-sided tests, because either the mean > k or mean < k would be a violation of H0

 

If you want to test to see if the mean is greater than or equal to some value k (as opposed to the mean being equal to k), this is a one sided test. For the two sample case, the one sided test would be H0: Mean1 > Mean 2

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 537 views
  • 5 likes
  • 3 in conversation