【发布时间】:2021-10-16 04:24:43
【问题描述】:
我将一些数据拟合成泊松分布,数据如下:
observed <- c(290, 630, 873, 853, 618, 310, 138, 54, 21, 9, 4)
estimated_prob_mass <- c(0.064, 0.176, 0.242, 0.222, 0.152, 0.084, 0.038, 0.015, 0.005, 0.002, 0.000)
从视觉上看,缩放分布非常适合数据。 我使用 ChiSq 拟合优度检验来检查数据,得到以下结果:
chisq.test(observed, p=estimated_prob_mass)
#Warning message in chisq.test(observed, p = estimated_prob_mass):
#"Chi-squared approximation may be incorrect"
#Chi-squared test for given probabilities
#data: observed
#X-squared = Inf, df = 10, p-value < 2.2e-16
在这种情况下,为什么我会得到无限的 ChiSq 值和接近零的 p 值?
【问题讨论】:
-
另外,如果您提供的概率之一是 0 并且观察到的计数不为 0,那么您当然会拒绝。显然,对于该数据来说,这是一个不可能的概率向量。
标签: r hypothesis-test