Section 19 Hypothesis Testing - Two Samples: Steps
19.1 Model
SBP = Overall Mean + Sampling Variability
yj=μ+ϵj
SBP = Overall mean + Group effect + Sampling variability
yij=μ+βi+ϵij
yij = j -th observation (replicate) in the i -th treatment
μ = overall mean effect
βi = effect of treatment group i
ϵij∼NID(0,σ2)
i = treatment index; i: 1, 2
j = observation index within each treatment; j: 1 to n
19.2 Assumptions
Values within each group are independent and normally distributed
Variances of the two groups are equal
19.3 Steps of Hypothesis testing
Identify the parameter of interest
Define HO and HA
Define a significance level α
Calculate an estimate of the parameter
Determine an appropriate test statistic, its distribution when HO is correct, calculate the value of test statistic from the sample
Obtain the probability under the distribution of the test statistic
Compare the observed probability given α and conclude
19.4 Two Samples, Unknown Variance
Inference for a difference in means of two Normal distributions when variances are unknown
19.5 Steps of Hypothesis testing: Details
- Identify the parameter of interest: Population mean μ
- Define HO and HA
HO:μ1=μ2
HA:μ1≠μ2
- Define α
α=0.05
- Calculate an estimate of the parameter
Sample Mean: ¯x1=1nn∑i=1x1i ¯x2=1nn∑i=1x2i
Pooled Sample Standard Deviation:
Scenario 1: Variances of TWO samples are equal
s=√(n1−1)s21+(n2−1)s22n1+n2−2
Scenario 2: Variances of TWO samples are NOT equal
s=√s21n1+s22n2
Where: s21 and s22 are variances from Sample 1 and Sample 2, respectively.
- Determine test statistic, its distribution when HO is correct, calculate the value of test statistic from the sample.
tCal=(¯x1−¯x2)−(μ1−μ2)s√1/n1+1/n2
tCal=(¯x1−¯x2)s√1/n1+1/n2
- Note - The test statistic is the difference of Observed Difference & Expected Difference - The test statistic represents the ratio of signal to error - The test statistic is centred and scaled
Distribution of the test statistic
Scenario 1: Variances of TWO samples are equal
tdistributionwith(n1+n2−2)df
Scenario 2: Variances of TWO samples are NOT equal
The degrees of freedom will be computed.
degreesoffreedom=(s21+s22)s21/(n1−1)+s22/(n2−1)
tdistributionwithcomputeddf
- Obtain the probability under the distribution of the test statistic (two-tailed probability)
2∗pt(q=|tCal|, df, lower.tail=FALSE)
- Compare the observed probability given the α and conclude
Find the probability that t is less than or equal to |tCal| from t distribution with (n1+n2−2) degrees of freedom for the Scenario 1. Use integer values of degrees of freedom for the Scenario 2.