BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
eeun1ilee
Fluorite | Level 6

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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:

 

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

 

 

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

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:

 

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

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 843 views
  • 7 likes
  • 2 in conversation