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;
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.