BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lizzy28
Quartz | Level 8

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
Reeza
Super User

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.

 

 

View solution in original post

6 REPLIES 6
art297
Opal | Level 21

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

 

Reeza
Super User

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.

 

 

Reeza
Super User

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.

 

 

art297
Opal | Level 21

@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

 

 

Reeza
Super User
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
lizzy28
Quartz | Level 8

I see your point. I initially thought that simply taking difference of group means was more like unpaired t-test as the observations were not paired.

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 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1246 views
  • 2 likes
  • 3 in conversation