- 单因素方差分析(假设因变量服从正态分布,各组方差相等)
# 正态性检验:用Shapiro-Wilk检验
cholesterol <- na.omit(cholesterol)
shapiro.test(cholesterol)
若P>α,则认为数据集服从正态分布。
注:常见问题及解决方法:
# 问题1
Error: is.numeric(x) is not TRU
cholesterol <- as.numeric(cholesterol)
# 问题2
Error: (list) object cannot be coerced to type 'double'
cholesterol <-