# ANOVA - Analysis of variance
import numpy as np
from scipy.stats import f_oneway
# Sample data: test scores from three teaching methods
method_A = [88, 92, 85, 91, 87]
method_B = [78, 85, 80, 83, 79]
method_C = [94, 89, 91, 96, 90]
# Perform one-way ANOVA
f_statistic, p_value = f_oneway(method_A, method_B, method_C)
# Display results
print(f"F-Statistic: {f_statistic}")
print(f"P-Value: {p_value}")
# Interpretation
alpha = 0.05
if p_value < alpha:
print("Reject the null hypothesis: There is a significant difference between the groups.")
else:
print("Fail to reject the null hypothesis: No significant difference between the groups.")