Bio 9/18

Chi-square Analysis: Goodness of Fit Test

  • Chi-square Formula: Used for categorical data, not continuous. Compares observed data against expected values under the null hypothesis.

  • Null Hypothesis (H0): Represents no difference (e.g., equal outcomes). Tested against an Alternative Hypothesis (H1).

  • Goodness of Fit Test: Evaluates how well observed data conform to expected data based on H0.

  • Calculation Example:

    • Observed outcomes from coin flips: 12 heads, 8 tails in 20 flips.

    • Expected outcomes for fairness: 10 heads, 10 tails.

    • Calculation: χ2=(observedexpected)2expected=(1210)210+(810)210=0.8\chi^2 = \sum \frac{(observed - expected)^{2}}{expected} = \frac{(12-10)^{2}}{10} + \frac{(8-10)^{2}}{10} = 0.8

  • Degrees of Freedom (df): Calculated by categories - 1.

    • Example: For 2 outcomes (heads/tails), df = 1.

  • Chi-square Distribution Table: Used to determine significance of calculated χ2\chi^2.

    • Critical value for df=1 at α = 0.05 is 3.84.

  • Decision Rule:

    • If \chi^2 < C: Fail to reject H0.

    • If \chi^2 > C: Reject H0, support H1.

  • Conclusion from Example:

    • Calculated \chi^2 = 0.8 < 3.84 means no bias in the coin (fail to reject H0).

  • Multiple Outcomes:

    • For more than 2 outcomes, divide sample size by number of categories for expected values.

  • Unequal Probabilities:

    • Adjust expected values based on known ratios (e.g., 75% yellow, 25% white flowers).

    • All calculations follow the same methodology as for equal probabilities, adjusted accordingly.