Hello,
I'm a SAS beginner who needs help:( I'm not sure if this makes sense but
I need to perform a two-sample t-test given sample sizes, means, and standard deviations:
N1 = 46
N2 = 54
mean for N1 = 1.32
mean for N2 = 0.96
std dev for N1 = 2.25
std dev for N2 = 2.18
Is it possible to perform the test? I've only performed statistical tests using datasets. Thank you.
Hello @eeun1ilee,
The SAS documentation is really good and in the documentation of the DATA= option of the PROC TTEST statement you find a link "Input Data Set of Statistics" explaining how an input data set containing summary statistics needs to look like. Better yet, the first example for PROC TTEST, Example 127.1 Using Summary Statistics to Compare Group Means, demonstrates exactly this technique.
It's quite easy:
data want;
input c _stat_ $ x;
cards;
1 n 46
2 n 54
1 mean 1.32
2 mean 0.96
1 std 2.25
2 std 2.18
;
proc ttest data=want;
class c;
var x;
run;
Hello @eeun1ilee,
The SAS documentation is really good and in the documentation of the DATA= option of the PROC TTEST statement you find a link "Input Data Set of Statistics" explaining how an input data set containing summary statistics needs to look like. Better yet, the first example for PROC TTEST, Example 127.1 Using Summary Statistics to Compare Group Means, demonstrates exactly this technique.
It's quite easy:
data want;
input c _stat_ $ x;
cards;
1 n 46
2 n 54
1 mean 1.32
2 mean 0.96
1 std 2.25
2 std 2.18
;
proc ttest data=want;
class c;
var x;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.