Genetics for Medical Students: Chi-Square Test and Statistical Analysis Notes (copy)

Definition and Fundamental Applications of the Chi-Square Test

  • Definition: A chi-square test is a statistical test used to compare observed results with expected results.

  • Primary Purpose: To determine if a difference between observed data and expected data is due to chance, or if it is due to a relationship between the variables being studied.

  • General Application in Genetics:

    • Analyzing Mendelian inheritance patterns.

    • Determining if observed genetic crosses align with expected ratios.

    • Understanding gene expression and inheritance mechanisms.

  • Pearson’s Chi-Square Tests: This is one of the most common applications of chi-square distributions. These are statistical tests designed for categorical data to determine whether the data significantly differs from what was expected.

  • Frequency Distribution Hypotheses: The test is used to address questions such as:

    • Does the frequency distribution of kernel colour in maize follow a hypothetical genetic ratio?

    • Do individuals from several treatments in the same experiment belong to the same population distribution?

    • Are the frequency distributions of two or more populations independent of each other?

Classification of Experimental Data: Measurement vs. Attribute

  • Measurement Data: Data specified along a continuous numerical scale. Examples include:

    • Yield.

    • Plant height.

    • Protein content.

  • Attribute Data: Concerned with a finite number of discrete classes. Classes are often defined by the presence or absence of an attribute. Examples include:

    • Two-class systems: Male or female, success or failure, effective or ineffective, dead or alive.

    • Multiple-class systems: Varietal classification, colour classification.

  • Classification Criteria:

    • One-way classification: Only one criterion is used (e.g., presence/absence of one character, colour classification of plant tissue, or tenure status of farmers).

    • Two-way (and higher) classification: More than one criterion is used to specify the classes.

  • Discrete Classification of Quantitative Measurements: In special cases, quantitative data can be grouped into discrete classes:

    • Classifying plants into three height classes (tall\text{tall}, intermediate\text{intermediate}, and short\text{short}) instead of measuring in centimeters (cmcm).

    • Scoring vertical resistance to insect pests on a scale from 00 through 99 instead of measuring the actual percentage of plant damage.

Statistical Tests for Homogeneity of Variance (Bartlett’s Test)

  • Bartlett’s Test: A statistical procedure for testing the equality (homogeneity) of several variances.

  • Usage in Agricultural Research:

    • Verifying homogeneity of variances as a requirement for a valid analysis of variance (ANOVA\text{ANOVA}).

    • Verifying homogeneity of error variances when combining data from a series of experiments.

    • Verifying homogeneity of variances in genetic studies where materials consist of genotypes from different filial generations.

    • Verifying homogeneity of sampling variances among samples taken from two or more populations.

  • Application Constraint: The chi-square test for homogeneity of variances is applied whenever more than two variances are tested.

Probability Distributions in Agricultural Research

  • Test of Goodness of Fit: Determines whether a set of observed data conforms to a specified probability distribution.

  • Normal Distribution:

    • The most important continuous distribution in agricultural research (e.g., data on rice yield or protein).

    • Characteristics: Bell-shaped, asymmetric (according to the transcript), and governed by two parameters (mean\text{mean} and variance\text{variance}).

  • Poisson Distribution:

    • A discrete distribution used to represent the occurrence of rare events over space or time (e.g., spatial distribution of weeds in a rice field, insects caught in traps).

    • Characteristics: Governed by a single parameter which serves as both the mean\text{mean} and the variance\text{variance}.

Mathematical Formula and the Null Hypothesis

  • The Null Hypothesis (H0H_0): States that there is no significant difference between the expected and observed results.

  • Chi-Square Formula:     χ2=(oe)2e\chi^2 = \frac{(o - e)^2}{e}

    • Alternative notation: Chi-square is the sum of the squared difference between observed (oo) and expected (ee) data (the deviation, dd), divided by the expected data in all possible categories.

  • General Formula for Test Statistic:     χ2=[(OiEi)2Ei]\chi^2 = \sum \left[ \frac{(O_i - E_i)^2}{E_i} \right]

    • OiO_i: Observed frequency count for the ithi^{\text{th}} level.

    • EiE_i: Expected frequency count for the ithi^{\text{th}} level.

Case Study: Mendelian Inheritance in Pea Plants

  • Scenario: A cross between two pea plants yields 880880 plants: 639639 with green seeds and 241241 with yellow seeds.

  • Hypothesis: The allele for green is dominant to yellow (GG is dominant), and both parents are heterozygous.

  • Predicted Ratio: 3:13:1 (3/43/4 green; 1/41/4 yellow).

  • Expected Numerical Values:

    • Green seeds: 880×0.75=660880 \times 0.75 = 660

    • Yellow seeds: 880×0.25=220880 \times 0.25 = 220

  • Chi-Square Calculation (Table 1):

    • Green: Observed (639639), Expected (660660), Deviation (21-21), Deviation squared (441441), d2/e=0.668d^2/e = 0.668

    • Yellow: Observed (241241), Expected (220220), Deviation (2121), Deviation squared (441441), d2/e=2d^2/e = 2

    • Total χ2=0.668+2=2.668\chi^2 = 0.668 + 2 = 2.668

  • Interpretation:

    • Degrees of Freedom (dfdf): 2 categories1=12 \text{ categories} - 1 = 1.

    • P-Value: At χ2=2.668\chi^2 = 2.668 and df=1df = 1, the pp value is approximately 0.100.10.

    • Result: Since p > 0.05 (10%10\% chance), the deviation is non-significant and consistent with Mendel's Law.

Step-by-Step Procedure for Hypothesis Testing

  1. State the Hypothesis: Define the null hypothesis and predicted results.

  2. Gather Data: Conduct experiments or use provided data.

  3. Determine Expected Numbers: Calculate expected values (EiE_i) for each class. Use numerical values, not percentages.

    • Constraint: Chi-square should not be calculated if the expected value in any category is less than 55.

  4. Calculate χ2\chi^2: Complete calculations to three significant digits; round the final answer to two significant digits.

  5. Determine Significance:

    • Calculate degrees of freedom (df=k1df = k - 1).

    • Locate the value in the chi-square distribution table.

    • Find the associated pp value.

  6. State Conclusion:

    • If p > 0.05: Accept the hypothesis (deviation is due to chance alone).

    • If p < 0.05: Reject the hypothesis (factors other than chance are operating).

Statistical Tables: Chi-Square Distribution

Degrees of Freedom (dfdf)

0.95

0.90

0.80

0.70

0.50

0.30

0.20

0.10

0.05

0.01

0.001

1

0.004

0.02

0.06

0.15

0.46

1.07

1.64

2.71

3.84

6.64

10.83

3

0.35

0.58

1.01

1.42

2.37

3.66

4.64

6.25

7.82

11.34

16.27

4

0.71

1.06

1.65

2.20

3.36

4.88

5.99

7.78

9.49

13.28

18.47

5

1.14

1.61

2.34

3.00

4.35

6.06

7.29

9.24

11.07

15.09

20.52

6

1.63

2.20

3.07

3.83

5.35

7.23

8.56

10.64

12.59

16.81

22.46

7

2.17

2.83

3.82

4.67

6.35

8.38

9.80

12.02

14.07

18.48

24.32

8

2.73

3.49

4.59

5.53

7.34

9.52

11.03

13.36

15.51

20.09

26.12

9

3.32

4.17

5.38

6.39

8.34

10.66

12.24

14.68

16.92

21.67

27.88

10

3.94

4.86

6.18

7.27

9.34

11.78

13.44

15.99

18.31

23.21

29.59

  • Note: The values between p=0.95p = 0.95 and p=0.10p = 0.10 are generally non-significant. Values at p=0.05p = 0.05 and below are significant.

Advanced Case Study: Acme Toy Company Baseball Cards

  • The Claim: 30% rookies, 60% veterans, 10% All-Stars.

  • Random Sample (n=100n = 100): 50 rookies, 45 veterans, 5 All-Stars.

  • Hypotheses:

    • H0H_0: Rookies=30%\text{Rookies} = 30\%, Veterans=60%\text{Veterans} = 60\%, All-Stars=10%\text{All-Stars} = 10\%

    • HaH_a: At least one of the proportions in the null hypothesis is false.

  • Degrees of Freedom (dfdf): k1=31=2k - 1 = 3 - 1 = 2.

  • Expected Frequencies (Ei=n×piE_i = n \times p_i):

    • E1=100×0.30=30E_1 = 100 \times 0.30 = 30

    • E2=100×0.60=60E_2 = 100 \times 0.60 = 60

    • E3=100×0.10=10E_3 = 100 \times 0.10 = 10

  • Statistical Calculation:

    • χ2=(5030)230+(4560)260+(510)210\chi^2 = \frac{(50 - 30)^2}{30} + \frac{(45 - 60)^2}{60} + \frac{(5 - 10)^2}{10}

    • χ2=40030+22560+2510=13.33+3.75+2.50=19.58\chi^2 = \frac{400}{30} + \frac{225}{60} + \frac{25}{10} = 13.33 + 3.75 + 2.50 = 19.58

  • Interpretation:

    • P(\chi^2 > 19.58) = 0.0001.

    • Since 0.0001 < 0.05, the researcher rejects the null hypothesis.

  • Condition Check: The method is appropriate because:

    • Simple random sampling was used.

    • Variable is categorical.

    • All expected frequencies are 5\ge 5.

The Contingency Test (Chi-Square Test of Independence)

  • Definition: A test used to determine if there is a relationship between two categorical variables.

  • Contingency Table: A table displaying the frequencies of two or more categorical variables, helping to visualize relationships.

  • Independence: Two variables are independent if the occurrence of one does not affect the probability of the other.

  • Applications:

    1. Social Sciences: Relationships between demographics and opinions/behaviors.

    2. Medical Research: Associations between risk factors and disease outcomes; treatment effectiveness across groups.

    3. Marketing: Customer preferences, purchase patterns, and advertising effectiveness.

    4. Biology: Gene expression patterns or genetic variations across cell types.

    5. Cybersecurity: Comparing pre- and post-attack data to assess security effectiveness.

    6. Cryptanalysis: Comparing plaintext and ciphertext distributions to assess cipher strength.

      • Cipher: An algorithm used to encrypt/encode a message into ciphertext to protect confidentiality.

      • Plaintext: The original, unreadable content requiring a decryption algorithm and key to access.

    7. Goodness-of-Fit: Comparing observed frequencies with theoretical distributions (e.g., binomial).

  • Example Scenario: A study investigating the relationship between gender and movie preference (action, comedy, drama). The test determines if preferences are genuine relationships or random chance.