turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Using proc compare to compare means between 2 vari...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-01-2012 02:16 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-01-2012 02:25 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-01-2012 02:38 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-02-2012 03:47 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-02-2012 07:42 AM

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