R 适用于高计数数据-Inf&;楠
我有高计数数据,并从R 适用于高计数数据-Inf&;楠,r,poisson,goodness-of-fit,R,Poisson,Goodness Of Fit,我有高计数数据,并从vcd包中应用goodfit,如下所示: fishdata <- read.csv("http://dl.dropbox.com/s/4w0utkqdhqribl4/fishdata.csv", header=T) attach(fishdata) require(vcd) dat <- fishdata$inlandfao gf <- goodfit(dat, method="ML") gf2 <- goodfit(dat, method="MinC
vcd
包中应用goodfit
,如下所示:
fishdata <- read.csv("http://dl.dropbox.com/s/4w0utkqdhqribl4/fishdata.csv", header=T)
attach(fishdata)
require(vcd)
dat <- fishdata$inlandfao
gf <- goodfit(dat, method="ML")
gf2 <- goodfit(dat, method="MinChisq")
> summary(gf); summary(gf2)
Goodness-of-fit test for poisson distribution
X^2 df P(> X^2)
Likelihood Ratio Inf 60 0
Goodness-of-fit test for poisson distribution
X^2 df P(> X^2)
Pearson NaN 1218936 NaN
Warning message:
In summary.goodfit(gf2) : Chi-squared approximation may be incorrect
fishdata对于gf
,X^2值非常高,几乎是无限高。X^2值越高,P值越低。我不知道MinChisq是如何工作的,但1218936自由度闻起来很可疑。可能是因为DF太多,无法准确计算X^2值(因此发出警告)?但是,我建议您重新考虑您的分析。首先绘制数据,然后根据要回答的问题确定要适合的模型。尝试库(重塑2);图书馆(GG2);fd