5.1单样本t检验
daily.intake<-c(5260,5470,5640,6180,6390,6515,6805,7515,8230,8770)
mean(daily.intake)#求均值
[1] 6677.5
sd(daily.intake)#计算标准差
[1] 1174.11
quantile(daily.intake)#四分位数点
0% 25% 50% 75% 100%
5260.0 5775.0 6452.5 7337.5 8770.0
t.test(daily.intake,mu=7725)#检验分布是否满足mu等于7725,
One Sample t-test
data: daily.intake
t = -2.8213, df = 9, p-value = 0.02001
alternative hypothesis: true mean is not equal to 7725
95 percent confidence interval:
5837.592 7517.408
sample estimates:
mean of x
6677.5
#wilcoxon符号秩检验
wilcox.test(daily.intake,mu