SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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