```R # 原假设与备择假设 # 原假设:强化集训前后学生成绩没有显著提升(即平均成绩没有变化) # 备择假设:强化集训前后学生成绩有显著提升(即平均成绩有变化) # 计算检验统计量的样本值 before <- c(82, 59, 77, 50, 64, 76, 55, 64, 75, 75, 62, 79, 81, 73, 60) after <- c(97, 64, 75, 67, 89, 70, 66, 91, 67, 75, 86, 86, 85, 96, 80) # 使用配对样本 t 检验 t_stat <- t.test(before, after, paired=TRUE)$statistic print(t_stat) # 检验该课程的这种强化集训能否提升学生成绩 # 1) 大于 5 分 p_value_5 <- 1 - pt(t_stat, df = 14) if (p_value_5 < 0.05) { print("Reject the null hypothesis: the training can improve student scores by more than 5 points.") } else { print("Fail to reject the null hypothesis.") } # 2) 小于 10 分 p_value_10 <- pt(t_stat, df = 14) if (p_value_10 < 0.05) { print("Reject the null hypothesis: the training can improve student scores by less than 10 points.") } else { print("Fail to reject the null hypothesis.") } ``` [2024-11-26 22:00:01 | AI写代码神器 | 630点数解答]