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;

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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
  • 1065 views
  • 7 likes
  • 2 in conversation