Hypothesis Testing: Two Independent Samples and Chi-Square Procedures

Chi-Square Goodness-of-Fit Test (One Sample, Categorical Outcome)

  • Application: Used for a single sample with a categorical or ordinal outcome (with kk categories) to assess agreement between observed sample frequencies and frequencies expected under the null hypothesis.

  • Hypotheses:

    • Null hypothesis: H0:p1=p10,p2=p20,…,pk=pk0H_0: p_1 = p_{10}, p_2 = p_{20}, \dots, p_k = p_{k0}, where p10,p20,…,pk0p_{10}, p_{20}, \dots, p_{k0} represent the expected population proportions.
    • Alternative hypothesis: HA:H0 is falseH_A: H_0 \text{ is false}.
  • Expected Frequencies (EE): Calculated as E=n×p0E = n \times p_0 for each category, where nn is the total sample size.

  • Test Statistic:χ2=∑(O−E)2E\chi^2 = \sum \frac{(O - E)^2}{E}

    • OO = observed frequency
    • EE = expected frequency under H0H_0
    • When H0H_0 is true, χ2\chi^2 is close to 00; when H0H_0 is false, χ2\chi^2 is large.
  • Degrees of Freedom & Decision Rule:

    • Degrees of freedom: df=k−1df = k - 1
    • Decision rule: Reject H0H_0 if χ2>Critical Value from Table 3\chi^2 > \text{Critical Value from Table 3}.

Chi-Square distribution curve showing the rejection region at alpha = 0.05

Chi-Square Test of Independence (Two or More Samples, Categorical Outcome)

  • Application: Used to evaluate whether two categorical or ordinal variables are related across two or more independent comparison groups.

  • Hypotheses:

    • Null hypothesis: H0:The distribution of the outcome is independent of the groupsH_0: \text{The distribution of the outcome is independent of the groups} (treatment/group and outcome are independent).
    • Alternative hypothesis: HA:H0 is falseH_A: H_0 \text{ is false}.
  • Expected Cell Frequency Calculation:E=Row Total×Column TotalNE = \frac{\text{Row Total} \times \text{Column Total}}{N}

    • NN = total overall sample size.
  • Test Statistic:χ2=∑(O−E)2E\chi^2 = \sum \frac{(O - E)^2}{E}

  • Degrees of Freedom & Decision Rule:

    • Degrees of freedom: df=(r−1)(c−1)df = (r - 1)(c - 1), where rr is the number of rows and cc is the number of columns.
    • Decision rule: Reject H0H_0 if χ2>Critical Value from Table 3\chi^2 > \text{Critical Value from Table 3}.

Two Independent Samples: Continuous Outcome

  • Application: Compares means (μ1−μ2\mu_1 - \mu_2) between two independent groups for a continuous outcome variable (e.g., blood pressure, weight, cholesterol).

  • Hypotheses:

    • Null hypothesis: H0:μ1=μ2H_0: \mu_1 = \mu_2 (or μ1−μ2=0\mu_1 - \mu_2 = 0).
    • Alternative hypothesis options:
    • One-sided upper: HA:μ1>μ2H_A: \mu_1 > \mu_2
    • One-sided lower: HA:μ1<μ2H_A: \mu_1 < \mu_2
    • Two-sided: HA:μ1≠μ2H_A: \mu_1 \neq \mu_2
  • Equal Variance Assumption & Pooled Standard Deviation (SpS_p):

    • The equal variance assumption (σ12=σ22\sigma_1^2 = \sigma_2^2) is considered reasonable if:     0.5<s12s22<2.00.5 < \frac{s_1^2}{s_2^2} < 2.0
    • Pooled standard deviation formula:     Sp=(n1−1)s12+(n2−1)s22n1+n2−2S_p = \sqrt{\frac{(n_1 - 1)s_1^2 + (n_2 - 1)s_2^2}{n_1 + n_2 - 2}}
  • Test Statistics by Sample Size:

    • Large samples (n1>30n_1 > 30 and n2>30n_2 > 30):     Z=Xˉ1−Xˉ2Sp1n1+1n2Z = \frac{\bar{X}_1 - \bar{X}_2}{S_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}
    • Small samples (n1<30n_1 < 30 or n2<30n_2 < 30):     t=Xˉ1−Xˉ2Sp1n1+1n2t = \frac{\bar{X}_1 - \bar{X}_2}{S_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}
    • Degrees of freedom: df=n1+n2−2df = n_1 + n_2 - 2.

Two Independent Samples: Dichotomous Outcome

  • Application: Compares proportions (p1−p2p_1 - p_2) of a binary or dichotomous success/failure outcome across two independent groups.

  • Hypotheses:

    • Null hypothesis: H0:p1=p2H_0: p_1 = p_2
    • Alternative hypothesis options:
    • One-sided upper: HA:p1>p2H_A: p_1 > p_2
    • One-sided lower: HA:p1<p2H_A: p_1 < p_2
    • Two-sided: HA:p1≠p2H_A: p_1 \neq p_2
  • Overall Pooled Proportion (pp):p=Total SuccessesTotal Sample Size=x1+x2n1+n2p = \frac{\text{Total Successes}}{\text{Total Sample Size}} = \frac{x_1 + x_2}{n_1 + n_2}

  • Test Statistics:

    • When sample sizes are large (n1>30n_1 > 30 and n2>30n_2 > 30):     Z=p1−p2p(1−p)(1n1+1n2)Z = \frac{p_1 - p_2}{\sqrt{p(1 - p)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}
    • When sample sizes are small (n1<30n_1 < 30 or n2<30n_2 < 30):     t=p1−p2p(1−p)(1n1+1n2)t = \frac{p_1 - p_2}{\sqrt{p(1 - p)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}