Displaying 2 results from an estimated 2 matches for "chi2_".
Did you mean:
chi2
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
...1]
th_ p[2]
ll _ -sum(x[1:max(kk)]*log(dnbinom(kk[-length(kk)],r,th))) -
x[length(kk)]*log(1-pnbinom((max(kk)-1),r,th))
return(ll)
}
a_ nlm(fn,p=c(.9,.5),hes=T)
est_ a$est
phat_ c(dnbinom(kk[-length(kk)],est[1],est[2]),
1-pnbinom((max(kk)-1),est[1],est[2]))
E_ n*phat
chi2_ sum((x-E)^2/E)
cat('Chi2 goodness-of-fit = ',chi2,'\n')
cat('P-value=',1-pchisq(chi2,df=length(kk)-1-2),'\n')
print(cbind(O=x,E=round(E,1),err=round((x-E)^2/E,1)))
===========================================
At 02:31 PM 2/8/01 +0000, Mark Wyatt wrote:
>Yudi,
&g...
2001 Feb 07
3
Goodness of fit to Poisson / NegBinomial
All,
I have some data on parasites on apple leaves and want to do a
goodness of fit test to a Poisson distribution. This seems to
do it:
mites <- c(rep(0,70),
rep(1,38),
rep(2,17),
rep(3,10),
rep(4,9),
rep(5,3),
rep(6,2),
rep(7,1))
tab <- table(mites)
NSU <- length(mites)
N <-