Download presentation
Presentation is loading. Please wait.
2
Comparison of 2 or more means ( See Chapter 11)
3
e.g. n=16, df=15, alpha=0.05 t- statistic under H0 are ±2.13 Is = 0 ? -- consider versus or One sample t test
4
Population (Normal) T-treatmentC-control TT CC TT CC H 0 : T = C Two sample t
5
Population (Normal) T-treatmentC-control TT CC TT CC Sample nTnT nCnC sTsT sCsC H 0 : T = C Two sample t
6
1.Samples dependent (Paired) (1 sample of subjects, 2 measures/subject) 2.Samples independent (2 independent samples of subjects, 1 measure per subject) 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 –Question: Is there evidence that the time to angina is shorter when there is exposure to Co?
8
Plain air Carbon monoxide Example – Paired study (Partial data)
9
Plain air Carbon monoxide Example – Paired study
10
Plain air Carbon monoxide Example – Paired study
11
Response Error Model for a Subject (s): At time 1 (Control) At time 2 (same) Measured under same conditions!
12
Example – Paired study Response Error Model for a Subject: At time 1 (control) At time 2 (with CO) Measured under different conditions! = The condition effect
13
Example – Paired study Take Difference -At time 1 At time 2 (+CO) Take Sample of Subjects, Test whether -CO reduces time to asthma
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 n=63. Calculate p value for H 0 : μ=0 vs Ha: μ not 0
16
n= 63 Example - Paired study (Hypothesis test) Compare with t (.05,62)= -1.671 Since tcal<-1.671, reject Ho. Conclude time is shorter.
17
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 2. For two independent samples:
18
If T C (recommended) and degrees of freedom, : Heteroscedastic
19
If T = C (which can be tested) we can use a common value: Homoscedastic
20
Two samples (groups): Treatment Control 4 7 6 6 2 9 5 10 Example
21
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
22
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
23
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
24
Summary Paired test Hypothesis test CI 2 independent samples: –Hypothesis test for equal/unequal variance –CI under equal/unequal variance
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.