BookmarkSubscribeRSS Feed
Dan_yu_W
Obsidian | Level 7

Hello.

I have two surveys (asking the same question) which are combined into one single dataset (table below)

What I'm interested in is testing whether the means in survey 1 is the same as the means in survey 2 (in this case is the mean of 6,8 in survey 1 statistical different from 6,2 in survey 2).

I had been thinking of using proc compare in this ways:

proc compare base=test allstats briefsummary;

var survey_1; with survey_2;

run;

but I had been unsure whether the procedure actually will test the 2 means against each other using the std.dev. in both surveys or is the procedure actually doing a multiple testing of whether

5 = [empty],

7 = 7

[empty] = 7

etc.

Data: Test

IDSurvey_1 (avg=6,8)Survey_2 (avg 6,2)
15
277
37
48
596
658
73

Really appreciate any kind of help

/Dan

4 REPLIES 4
PaigeMiller
Diamond | Level 26

As far as I know, PROC COMPARE doesn't actually compare the means to each other using a standard statistical test. PROC TTEST is what you want to use.

--
Paige Miller
Doc_Duke
Rhodochrosite | Level 12

Dan,

A paired T-test or PROC Univariate (on the difference score) are the tests that are appropriate here.  Of note, your example has less than half the observation with complete data (assuming the ID variable is unique to the person level).  Both of those tests will exclude the subjects who just took the test once.  That much missing data is causes me concern about generalizability.

PROC COMPARE is for comparing the raw data between two datasets.

Doc Muhlbaier

Duke

Dan_yu_W
Obsidian | Level 7

Thanks for the answers for far.

Isn't TTEST only appropriare for samples around 30 observations or less (small sample)?

In my actual dataset, I have around 4000 observations in total (3500 for survey 1 and 3000 for survey 2). Couldn't this be a problem testing the means using TTEST?

/Dan

SteveDenham
Jade | Level 19

TTEST is certainly appropriate, no matter the sample size, for this sort of comparison.  However, check what Doc said--if you have a lot of unpaired results (only one test for a subject), the generalizability is going to be limited to those that have complete records, and those subjects may very well not be representative of your full sample or the population you want to infer the results for.

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2104 views
  • 0 likes
  • 4 in conversation