【发布时间】:2014-03-02 16:00:39
【问题描述】:
我想进行理论上的卡方拟合优度检验:
actual <- c(20,80)
expected <- c(10,90)
chisq.test(expected,actual)
样本大小 n=100,alpha=0.05,df=1。这给出了 3.84 的临界 chi 值。我可以手动计算测试统计量为 ((20-10)^2)/10 + ((80-90)^2)/90 = 100/9 > 3.84
但是,上面的代码只是产生了
Pearson's Chi-squared test with Yates' continuity correction
data: expected and actual
X-squared = 0, df = 1, p-value = 1
我的错误在哪里?
【问题讨论】:
标签: r chi-squared significance goodness-of-fit