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

ϵijNID(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

  1. Identify the parameter of interest

  2. Define HO and HA

  3. Define a significance level α

  4. Calculate an estimate of the parameter

  5. Determine an appropriate test statistic, its distribution when HO is correct, calculate the value of test statistic from the sample

  6. Obtain the probability under the distribution of the test statistic

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


  1. Identify the parameter of interest: Population mean μ


  1. Define HO and HA


HO:μ1=μ2

HA:μ1μ2


  1. Define α

α=0.05


  1. Calculate an estimate of the parameter

Sample Mean: ¯x1=1nni=1x1i ¯x2=1nni=1x2i


Pooled Sample Standard Deviation:

Scenario 1: Variances of TWO samples are equal

s=(n11)s21+(n21)s22n1+n22

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.


  1. Determine test statistic, its distribution when HO is correct, calculate the value of test statistic from the sample.

tCal=(¯x1¯x2)(μ1μ2)s1/n1+1/n2

tCal=(¯x1¯x2)s1/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+n22)df

Scenario 2: Variances of TWO samples are NOT equal

The degrees of freedom will be computed.

degreesoffreedom=(s21+s22)s21/(n11)+s22/(n21)

tdistributionwithcomputeddf


  1. Obtain the probability under the distribution of the test statistic (two-tailed probability)

2pt(q=|tCal|, df, lower.tail=FALSE)


  1. 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+n22) degrees of freedom for the Scenario 1. Use integer values of degrees of freedom for the Scenario 2.