Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Difference in group means (PROC MEANS) vs means of difference (Paired ...

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-29-2018 12:29 PM
(1091 views)

Hi All,

This came to my attention while checking my data. I tried to see if there is any significant difference from time 1 to time 2 for a group of individuals after an intervention occurred between time1 and time2. So I checked the means of the variables of interest and also did paired t-test.

I thought that the difference in groups means (PROC MEANS first per time period, and then take difference between the two means) would be the same as the means of difference given by the paired t-tests, but it was not the case for all the variables. My understanding is that the means of difference given by the paired t-tests were calculated as the means of difference between two time periods.

I tried to do manual calculation and got the same results (some with the same values in difference in group means and means of difference, and some with different values in them). I was wondering if it is related to some random missing data or other reasons.

Could anyone see why?

Thanks a lot!

Lizi

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Are you expecting the paired t-test to have the exact same results as the unpaired t-test?

That's incorrect, the paired t-test will be different than the unpaired t-test.

https://www.quora.com/What-is-the-difference-between-a-paired-and-unpaired-t-test

The differences should be the same mathematically, but the standard deviation is different - different handling of the n's.

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

My guess would be that you have some missing values for time1 and time2. A paired t-test would only consider records that don't have missing values for time1 and time2.

Art, CEO, AnalystFinder.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Are you expecting the paired t-test to have the exact same results as the unpaired t-test?

That's incorrect, the paired t-test will be different than the unpaired t-test.

https://www.quora.com/What-is-the-difference-between-a-paired-and-unpaired-t-test

The differences should be the same mathematically, but the standard deviation is different - different handling of the n's.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Are you expecting the paired t-test to have the exact same results as the unpaired t-test?

That's incorrect, the paired t-test will be different than the unpaired t-test.

https://www.quora.com/What-is-the-difference-between-a-paired-and-unpaired-t-test

The differences should be the same mathematically, but the standard deviation is different - different handling of the n's.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@Reeza: While your response was marked as "the solution," I thought we ought to expand this discussion in case someone is looking to explain the difference that @lizzy28 asked about.

@lizzy28 compared the means obtained running proc means with those obtained running a paired t-test.

While you said that the differences should be the same mathematically .. I disagree! Obviously, I don't disagree that the paired and non-paired t-tests will be different even without missing values, but missing values will definitely have an effect on those means. e.g., here is an example comparing proc means and a paired t-test (which is what @lizzy28 was comparing). I also included a non-paired t-test as well:

data have; input time1 time2; cards; 1 3 2 5 99 . 7 8 . 15 5 5 . 14 ; proc means data=have; var time1 time2; run; proc ttest data=have; paired time2*time1; run;

Art, CEO, AnalystFinder.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I would say if you have missing values, that's a slightly different issue than say the 'base case' with all data. I'm not sure a paired t-test makes sense with missing data, because you're losing the paired test so if there are missing values the tests are not equivalent. I agree with you on that point

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.