Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comparison of 2 or more means Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health) for lecture material.

Similar presentations


Presentation on theme: "Comparison of 2 or more means Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health) for lecture material."— Presentation transcript:

1

2 Comparison of 2 or more means Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health) for lecture material

3 e.g. n=16, df=15, 0.05 points are ±2.13 Is  =  0 ? -- consider versus or One sample t test

4 Population (Normal) T-treatmentC-control TT CC TT CC H 0 :  T =  C Two sample t

5 Population (Normal) T-treatmentC-control TT CC TT CC Sample nTnT nCnC sTsT sCsC H 0 :  T =  C Two sample t

6 1.Samples dependent (Paired) 2.Samples independent Two situations:

7 Example – Paired study Each subject is tested under 2 conditions: –Time to angina when exposed to plain air –Time to angina when exposed to air + CO

8 Plain air Carbon monoxide Example – Paired study

9 Plain air Carbon monoxide Example – Paired study

10 Plain air Carbon monoxide Example – Paired study

11 Response Error Model for a Subject: At time 1 At time 2 Measured under same conditions!

12 Example – Paired study Response Error Model for a Subject: At time 1 At time 2 Measured under different conditions! = The condition effect

13 Example – Paired study Take Difference -At time 1 At time 2 Take Sample of Subjects, Test whether

14 So Look at the differences:

15 So treat the d’s as the data and perform a one-sample t-test: T-test Average change in time to angina = -6.63 SD of change in time to angina = 20.29 Calculate p value for H 0 : μ=0

16 n= 63 Example - Paired study (Hypothesis test)

17 Example - Paired Study (One sided CI) Obtain an UPPER BOUND for mean difference

18 In order to decide the s 1 2 and S 1 2 and the degrees of freedom we need to know whether, or not,  T =  C For two independent samples:

19 If  T   C (recommended) and degrees of freedom, : Heteroscedastic

20 If  T =  C (which can be tested) we can use a common value: Homoscedastic

21 Two samples (groups): Treatment Control 4 7 6 6 2 9 5 10 Example

22 Stata Output paired t. ttest var1 = var2 Paired t test ------------------------------------------------------------------------------ Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- var1 | 4 4.25.8539126 1.707825 1.532469 6.967531 var2 | 4 8.9128709 1.825742 5.094837 10.90516 ---------+-------------------------------------------------------------------- diff | 4 -3.75 1.493039 2.986079 -8.501518 1.001518 ------------------------------------------------------------------------------ Ho: mean(var1 - var2) = mean(diff) = 0 Ha: mean(diff) 0 t = -2.5117 t = -2.5117 t = -2.5117 P |t| = 0.0868 P > t = 0.9566

23 Stata Output unpaired t. ttest var1 = var2, unpaired Two-sample t test with equal variances ----------------------------------------------------------------------------- Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- var1 | 4 4.25.8539126 1.707825 1.532469 6.967531 var2 | 4 8.9128709 1.825742 5.094837 10.90516 ---------+-------------------------------------------------------------------- combined | 8 6.125.9149063 2.587746 3.96159 8.28841 ---------+-------------------------------------------------------------------- diff | -3.75 1.25 -6.80864 -.6913601 ------------------------------------------------------------------------------ Degrees of freedom: 6 Ho: mean(var1) - mean(var2) = diff = 0 Ha: diff 0 t = -3.0000 t = -3.0000 t = -3.0000 P |t| = 0.0240 P > t = 0.9880

24 Stata Output unpaired unequal. ttest var1 = var2, unpaired unequal Two-sample t test with unequal variances ------------------------------------------------------------------------------ Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- var1 | 4 4.25.8539126 1.707825 1.532469 6.967531 var2 | 4 8.9128709 1.825742 5.094837 10.90516 ---------+-------------------------------------------------------------------- combined | 8 6.125.9149063 2.587746 3.96159 8.28841 ---------+-------------------------------------------------------------------- diff | -3.75 1.25 -6.811938 -.6880619 ------------------------------------------------------------------------------ Satterthwaite's degrees of freedom: 5.97345 Ho: mean(var1) - mean(var2) = diff = 0 Ha: diff 0 t = -3.0000 t = -3.0000 t = -3.0000 P |t| = 0.0241 P > t = 0.9879

25 Summary Paired test Hypothesis test CI 2 independent samples: –Hypothesis test for equal/unequal variance –CI under equal/unequal variance


Download ppt "Comparison of 2 or more means Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health) for lecture material."

Similar presentations


Ads by Google