样本中多个百分比在总体中是否相等,怎样进行假设检验,求指教--
发布网友
发布时间:2022-04-29 15:07
我来回答
共1个回答
热心网友
时间:2023-10-14 08:11
单个正态总体,方差未知,做t检验。
先计算样本均值和样本方差,
然后逐个检验总体均值是否等于P1、P2、P3。
以下是R语言实现,p-value全都大于0.05,接收H0,所以P1、P2、P3三者相等啦。
> x<-c(0.4,0.14,0.36)
> t.test(x,mu=0.4)
One Sample t-test
data: x
t = -1.2372, df = 2, p-value = 0.3416
alternative hypothesis: true mean is not equal to 0.4
95 percent confidence interval:
-0.04777928 0.64777928
sample estimates:
mean of x
0.3
> t.test(x,mu=0.14)
One Sample t-test
data: x
t = 1.9795, df = 2, p-value = 0.1863
alternative hypothesis: true mean is not equal to 0.14
95 percent confidence interval:
-0.04777928 0.64777928
sample estimates:
mean of x
0.3
> t.test(x,mu=0.36)
One Sample t-test
data: x
t = -0.7423, df = 2, p-value = 0.5352
alternative hypothesis: true mean is not equal to 0.36
95 percent confidence interval:
-0.04777928 0.64777928
sample estimates:
mean of x
0.3
>追问这是用计算机处理的结果,请问,如果用卡方检验,该怎么做呢