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 k categories) to assess agreement between observed sample frequencies and frequencies expected under the null hypothesis.
Hypotheses:
Null hypothesis: H0:p1=p10,p2=p20,…,pk=pk0, where p10,p20,…,pk0 represent the expected population proportions.
Alternative hypothesis: HA:H0 is false.
Expected Frequencies (E): Calculated as E=n×p0 for each category, where n is the total sample size.
Test Statistic:χ2=∑E(O−E)2
O = observed frequency
E = expected frequency under H0
When H0 is true, χ2 is close to 0; when H0 is false, χ2 is large.
Degrees of Freedom & Decision Rule:
Degrees of freedom: df=k−1
Decision rule: Reject H0 if χ2>Critical Value from Table 3.
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 groups (treatment/group and outcome are independent).
Alternative hypothesis: HA:H0 is false.
Expected Cell Frequency Calculation:E=NRow Total×Column Total
N = total overall sample size.
Test Statistic:χ2=∑E(O−E)2
Degrees of Freedom & Decision Rule:
Degrees of freedom: df=(r−1)(c−1), where r is the number of rows and c is the number of columns.
Decision rule: Reject H0 if χ2>Critical Value from Table 3.
Two Independent Samples: Continuous Outcome
Application: Compares means (μ1−μ2) between two independent groups for a continuous outcome variable (e.g., blood pressure, weight, cholesterol).
Hypotheses:
Null hypothesis: H0:μ1=μ2 (or μ1−μ2=0).
Alternative hypothesis options:
One-sided upper: HA:μ1>μ2
One-sided lower: HA:μ1<μ2
Two-sided: HA:μ1=μ2
Equal Variance Assumption & Pooled Standard Deviation (Sp):
The equal variance assumption (σ12=σ22) is considered reasonable if:
0.5<s22s12<2.0
Pooled standard deviation formula:
Sp=n1+n2−2(n1−1)s12+(n2−1)s22
Test Statistics by Sample Size:
Large samples (n1>30 and n2>30):
Z=Spn11+n21Xˉ1−Xˉ2
Small samples (n1<30 or n2<30):
t=Spn11+n21Xˉ1−Xˉ2
Degrees of freedom: df=n1+n2−2.
Two Independent Samples: Dichotomous Outcome
Application: Compares proportions (p1−p2) of a binary or dichotomous success/failure outcome across two independent groups.
Hypotheses:
Null hypothesis: H0:p1=p2
Alternative hypothesis options:
One-sided upper: HA:p1>p2
One-sided lower: HA:p1<p2
Two-sided: HA:p1=p2
Overall Pooled Proportion (p):p=Total Sample SizeTotal Successes=n1+n2x1+x2
Test Statistics:
When sample sizes are large (n1>30 and n2>30):
Z=p(1−p)(n11+n21)p1−p2
When sample sizes are small (n1<30 or n2<30):
t=p(1−p)(n11+n21)p1−p2