Solved Exercises on ANOVA Conditions and Assumptions

Master ANOVA conditions and assumptions: normality, equal variances, independence, and their verification through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Normality Assumption Check
Exercise 1
A researcher collected test scores from three different teaching methods: Method A: 85, 87, 82, 88, 86; Method B: 78, 80, 76, 82, 79; Method C: 92, 90, 94, 91, 89. Test the normality assumption for each group at α = 0.05.
Definition:

Normality assumption: The data in each group should be approximately normally distributed for ANOVA to be valid.

Normality Checking Methodology:
  1. Calculate descriptive statistics for each group
  2. Construct normal probability plots (Q-Q plots)
  3. Apply formal tests (Shapiro-Wilk for small samples)
  4. Examine skewness and kurtosis
  5. Visually inspect histograms
  6. Make decision about normality
Step 1: Calculate descriptive statistics

Method A: Mean = 85.6, SD = 2.28, n = 5

Method B: Mean = 79.0, SD = 2.24, n = 5

Method C: Mean = 91.2, SD = 1.92, n = 5

Step 2: Apply Shapiro-Wilk test for each group

Method A: W = 0.956, p-value ≈ 0.75

Method B: W = 0.875, p-value ≈ 0.28

Method C: W = 0.964, p-value ≈ 0.80

Step 3: Check skewness and kurtosis

Method A: Skewness = -0.28, Kurtosis = -1.2

Method B: Skewness = 0.0, Kurtosis = -1.2

Method C: Skewness = -0.28, Kurtosis = -1.2

Values near 0 indicate normality

Step 4: Examine normal probability plots

Points should fall approximately along a straight line

Visual inspection shows reasonable linearity

Step 5: Make decision for each group

All p-values > 0.05, so we fail to reject H₀

There is insufficient evidence to conclude non-normality

Step 6: Overall conclusion

All three groups appear to satisfy the normality assumption

All groups pass normality tests (p > 0.05)
Final answer:

The normality assumption is satisfied for all three groups. The Shapiro-Wilk tests yield p-values greater than 0.05 for each group, indicating no significant departure from normality.

Applied rules:

• Shapiro-Wilk test: For small samples (n < 50)

• Decision rule: p-value > α → fail to reject normality

• Visual confirmation: Q-Q plots support statistical tests

Normality verification:

• Shapiro-Wilk p-values: A=0.75, B=0.28, C=0.80

• All values > 0.05

• Skewness and kurtosis near zero

2 Equal Variances Check
Exercise 2
Using the same data from Exercise 1, test the assumption of equal variances (homogeneity of variance) at α = 0.05 using Levene's test.
Definition:

Equal variances assumption: The population variances of all groups should be equal (homogeneity of variance).

Step 1: Calculate group variances

Method A: s²_A = 5.2

Method B: s²_B = 5.0

Method C: s²_C = 3.7

Step 2: Apply Levene's test procedure

Levene's test uses absolute deviations from group medians

For each observation: |x_ij - median_j|

Step 3: Calculate deviations from medians

Method A median = 86

Deviations: |85-86|=1, |87-86|=1, |82-86|=4, |88-86|=2, |86-86|=0

Average deviation = 1.6

Step 4: Continue for other groups

Method B median = 79

Deviations: 0, 1, 3, 3, 0 → Average = 1.4

Method C median = 91

Deviations: 1, 1, 3, 0, 2 → Average = 1.4

Step 5: Perform ANOVA on absolute deviations

ANOVA on deviations: F = 0.04

p-value ≈ 0.96

Step 6: Make decision

Since p-value (0.96) > α (0.05), we fail to reject H₀

Variances are not significantly different

Step 7: Alternative Bartlett's test

Bartlett's test: χ² = 0.25, df = 2, p-value ≈ 0.88

Same conclusion: fail to reject equal variances

Levene's test: F = 0.04, p = 0.96, fail to reject H₀
Final answer:

The equal variances assumption is satisfied. Levene's test yields a p-value of 0.96, which is greater than 0.05, indicating no significant difference in variances across groups.

Applied rules:

• Levene's test: More robust than Bartlett's for non-normal data

• Decision rule: p-value > α → fail to reject equal variances

• Robustness: ANOVA is somewhat robust to mild violations

Equal variances verification:

• Levene's test: p = 0.96 > 0.05

• Bartlett's test: p = 0.88 > 0.05

• Variances: 5.2, 5.0, 3.7 (similar)

3 Independence Verification
Exercise 3
A study compares test scores of students taught by three different instructors. Each instructor teaches a separate class. Students were randomly assigned to instructors. Assess the independence assumption and explain its importance.
Definition:

Independence assumption: Observations within and between groups must be independent of each other.

Step 1: Examine study design

Students randomly assigned to instructors

Each instructor teaches separate class

Students don't interact during study period

Step 2: Assess within-group independence

Random assignment minimizes correlation between students

Separate classes prevent interaction during study

Within-group independence appears satisfied

Step 3: Assess between-group independence

Different instructors teach different classes

No communication between groups during study

Between-group independence appears satisfied

Step 4: Identify potential threats

Classroom environment differences

Time of day effects

These are controlled through design

Step 5: Importance of independence

Violations inflate Type I error rate

Standard errors become underestimated

Confidence intervals become too narrow

Step 6: Design considerations

Random assignment helps ensure independence

Blinding reduces potential correlations

Control for confounding variables

Independence appears satisfied through random assignment and separate classes
Final answer:

The independence assumption appears satisfied. Random assignment and separate classes minimize correlations between observations, meeting the independence requirement for ANOVA.

Applied rules:

• Random assignment: Helps ensure independence

• Design features: Separate classes prevent contamination

• Consequences: Violations affect Type I error rate

Independence verification:

• Random assignment used

• Separate classes taught independently

• No interaction between groups

ANOVA Assumptions and Verification
\( \text{Normality: } \epsilon_{ij} \sim N(0, \sigma^2) \quad \text{Equal Variances: } \sigma_1^2 = \sigma_2^2 = \ldots = \sigma_k^2 \)
ANOVA Assumption Formulas
Normality
\( \epsilon_{ij} \sim N(0, \sigma^2) \)
Errors normally distributed
Independence
\( \text{Cov}(\epsilon_i, \epsilon_j) = 0 \)
Errors independent
Equal Variances
\( \sigma_1^2 = \sigma_2^2 = \ldots \)
Homogeneity of variance
Key definitions:

Normality assumption: The residuals (errors) in each group are normally distributed.

Equal variances (homogeneity): The population variances of all groups are equal.

Independence: Observations are independent of each other within and between groups.

Random sampling: Data comes from random samples from each population.

Linearity: The relationship between dependent and independent variables is linear.

Homoscedasticity: Constant variance across all levels of the independent variable.

Complete Assumption Verification Methodology:
  1. Study design review: Assess how data was collected
  2. Normality check: Use tests (Shapiro-Wilk) and plots (Q-Q)
  3. Equal variances: Apply Levene's or Bartlett's test
  4. Independence: Evaluate study design and data collection
  5. Residual analysis: Examine residuals for patterns
  6. Outlier detection: Identify influential observations
  7. Decision making: Determine if assumptions are satisfied
  8. Alternatives: Consider if assumptions violated
Tip 1: ANOVA is robust to mild normality violations with large samples.
Tip 2: Levene's test is more robust than Bartlett's for non-normal data.
Tip 3: Independence is the most critical assumption to satisfy.
Tip 4: Visual methods complement formal statistical tests.
Tip 5: Consider transformations when assumptions are violated.

Common applications: Clinical trials, agricultural experiments, industrial quality control, educational research.
Violations consequences: Inflated Type I error, reduced power, incorrect confidence intervals.
Verification methods for each assumption:

• Normality: Shapiro-Wilk, Anderson-Darling, Q-Q plots, histogram

• Equal variances: Levene's test, Bartlett's test, Brown-Forsythe

• Independence: Study design evaluation, Durbin-Watson for time series

When assumptions fail:

• Use non-parametric alternatives (Kruskal-Wallis)

• Apply data transformations (log, square root)

• Use Welch's ANOVA for unequal variances

• Increase sample size to invoke central limit theorem

Solution: Exercises 4 to 5
4 Assumption Violation Detection
Exercise 4
A dataset shows: Group 1: 10, 12, 14, 16, 18, 100; Group 2: 20, 22, 24, 26, 28, 30; Group 3: 30, 32, 34, 36, 38, 40. Identify which ANOVA assumptions are violated and suggest remedies.
Definition:

Assumption violations: When the data fails to meet one or more of ANOVA's underlying assumptions.

Step 1: Examine descriptive statistics

Group 1: Mean = 28.3, SD = 35.1, Median = 15

Group 2: Mean = 25.0, SD = 3.8, Median = 25

Group 3: Mean = 35.0, SD = 3.8, Median = 35

Step 2: Check for outliers

Group 1: Value 100 is clearly an outlier

It's more than 2.5 times the interquartile range above Q3

Step 3: Test normality

Group 1: Shapiro-Wilk test likely shows significant departure from normality

Due to the outlier, normality assumption is violated

Step 4: Test equal variances

Group 1 variance (1232) much larger than Groups 2 and 3 (14.4)

Levene's test would show significant violation of equal variances

Step 5: Assess impact

The outlier in Group 1 violates both normality and equal variance assumptions

Could lead to inflated Type I error

Step 6: Suggest remedies

Option 1: Remove the outlier if it's a data entry error

Option 2: Apply log transformation to reduce impact

Option 3: Use non-parametric Kruskal-Wallis test

Normality and equal variances violated due to outlier
Final answer:

Both normality and equal variances assumptions are violated due to the outlier (100) in Group 1. Consider removing the outlier, applying transformations, or using non-parametric methods.

Applied rules:

• Outlier impact: Single outliers can severely violate assumptions

• Remedies: Removal, transformation, or non-parametric alternatives

• Verification: Always check for outliers before ANOVA

5 Formal Assumption Testing
Exercise 5
A researcher collected data from four groups (n=8 each) and wants to conduct ANOVA. Perform formal assumption testing: Group 1: 12, 14, 13, 15, 14, 16, 13, 15; Group 2: 18, 20, 19, 21, 17, 19, 20, 18; Group 3: 22, 24, 23, 25, 21, 23, 24, 22; Group 4: 16, 18, 17, 19, 15, 17, 18, 16.
Definition:

Formal testing: Using statistical tests to rigorously evaluate whether assumptions are satisfied.

Step 1: Calculate descriptive statistics

Group 1: Mean = 14.0, SD = 1.10, n = 8

Group 2: Mean = 19.0, SD = 1.31, n = 8

Group 3: Mean = 23.0, SD = 1.31, n = 8

Group 4: Mean = 17.0, SD = 1.31, n = 8

Step 2: Test normality for each group

Shapiro-Wilk tests (for n=8):

Group 1: W = 0.94, p = 0.62

Group 2: W = 0.96, p = 0.78

Group 3: W = 0.96, p = 0.78

Group 4: W = 0.94, p = 0.62

Step 3: Apply Levene's test for equal variances

Levene's test: F = 0.12, df1 = 3, df2 = 28, p = 0.95

Step 4: Assess independence

Groups are independent samples

No apparent correlation between groups

Step 5: Make decisions for each assumption

Normality: All p-values > 0.05 → Satisfied

Equal variances: p = 0.95 > 0.05 → Satisfied

Independence: Design-based → Satisfied

Step 6: Conclusion

All ANOVA assumptions are satisfied

Proceed with parametric ANOVA

All assumptions satisfied: Normality (all p > 0.60), Equal variances (p = 0.95)
Final answer:

All ANOVA assumptions are satisfied. Proceed with the parametric ANOVA analysis. All groups show normality (p > 0.05) and equal variances (p = 0.95).

Applied rules:

• Formal testing: Use statistical tests with decision rules

• Multiple tests: Check all assumptions systematically

• Decision rules: Compare p-values with α level

Detailed Concepts and Applications
\( \text{Levene's Test Statistic: } W = \frac{(N-k)}{(k-1)} \cdot \frac{\sum_{i=1}^{k} n_i(\bar{Z}_{i.} - \bar{Z}_{..})^2}{\sum_{i=1}^{k} \sum_{j=1}^{n_i}(Z_{ij} - \bar{Z}_{i.})^2} \)
Levene's Test Formula
Key definitions:

Parametric tests: Statistical tests that make assumptions about population parameters and distributions.

Non-parametric alternatives: Distribution-free tests that don't require normality assumptions.

Robustness: The ability of a statistical procedure to perform well even when assumptions are violated.

Power: The probability of correctly rejecting a false null hypothesis.

Type I error: Incorrectly rejecting a true null hypothesis (false positive).

Type II error: Failing to reject a false null hypothesis (false negative).

Advanced Assumption Checking Methodology:
  1. Design review: Examine how data was collected and organized
  2. Descriptive analysis: Calculate means, variances, and identify outliers
  3. Visual inspection: Create histograms, boxplots, Q-Q plots
  4. Formal testing: Apply statistical tests for each assumption
  5. Residual analysis: Examine residuals for patterns
  6. Sensitivity analysis: Test robustness to violations
  7. Alternative methods: Consider non-parametric tests if needed
  8. Reporting: Document all assumption checks
Tip 1: ANOVA is more robust to normality violations than equal variance violations.
Tip 2: Large samples help meet normality assumption through central limit theorem.
Tip 3: Unequal sample sizes make ANOVA more sensitive to variance inequality.
Tip 4: Use both visual and formal methods for assumption checking.

Tip 5: Always report assumption checking results in your analysis.

Common applications: Medical research, agricultural studies, industrial experiments, behavioral sciences.
Advanced considerations: Mixed models, repeated measures, factorial designs, generalized linear models.
Key principles and guidelines:

• Robustness principle: ANOVA is relatively robust to minor violations

• Sample size effect: Larger samples provide more robustness

• Unequal variances: More problematic with unequal sample sizes

• Visual methods: Complement formal tests for better insight

• Practical significance: Consider severity of violations

Additional considerations:

• ANOVA is more sensitive to outliers than to normality

• Balanced designs (equal sample sizes) are more robust

• Consider bootstrap methods for non-standard situations

• Multiple imputation for missing data issues

Questions & Answers

Question: How robust is ANOVA to violations of its assumptions?

Answer: ANOVA has different levels of robustness to different assumption violations:

  • Normality: ANOVA is quite robust to violations of normality, especially with larger sample sizes due to the Central Limit Theorem
  • Equal variances: More sensitive, particularly with unequal sample sizes
  • Independence: Critical assumption; violations seriously affect results

ANOVA is most robust when:

  • Sample sizes are equal (balanced design)
  • Sample sizes are large (n ≥ 30 per group)
  • Deviations from assumptions are mild

However, severe violations can lead to inflated Type I error rates or reduced power. When in doubt, consider non-parametric alternatives or data transformations.

The key is to assess the severity of violations and consider the impact on your specific analysis.

Question: What's the difference between Levene's test and Bartlett's test for equal variances?

Answer: Both tests evaluate the equal variances assumption, but they differ in robustness:

  • Bartlett's test: More powerful when data is normally distributed, but very sensitive to departures from normality
  • Levene's test: More robust to non-normality, uses absolute deviations from medians or means

Recommendation:

  • Use Levene's test when normality is questionable
  • Use Bartlett's test when you're confident data is normal
  • Levene's test is generally preferred in practice

Levene's test works by performing ANOVA on the absolute deviations from group medians (Brown-Forsythe variant) or means. This makes it less sensitive to non-normal distributions.

Both tests have the same null hypothesis: all group variances are equal.

Question: What should I do if my data violates ANOVA assumptions?

Answer: When ANOVA assumptions are violated, consider these alternatives:

  • Data transformation: Log, square root, or other transformations to achieve normality/equal variances
  • Non-parametric test: Kruskal-Wallis test for location differences
  • Welch's ANOVA: For unequal variances with normal data
  • Bootstrap methods: Resampling approach that doesn't rely on distributional assumptions

Specific approaches by violation:

  • Non-normality: Transform data or use non-parametric tests
  • Unequal variances: Welch's ANOVA or transformations
  • Outliers: Remove if data errors, or use robust methods

Always consider the severity of violations. Mild violations may not require alternative methods, especially with large samples.

Document any assumption violations and justify your choice of alternative method.

Remember that sometimes the research question can be addressed differently if traditional ANOVA isn't appropriate.