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
ID | Survey_1 (avg=6,8) | Survey_2 (avg 6,2) |
---|---|---|
1 | 5 | |
2 | 7 | 7 |
3 | 7 | |
4 | 8 | |
5 | 9 | 6 |
6 | 5 | 8 |
7 | 3 |
Really appreciate any kind of help
/Dan
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.
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
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
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.