Re: [R] test the goodness of it for negative binomial type 2

2010-03-08 Thread casperyc
Hi Achim Zeileis-4, That's very helpful. Thanks! -- View this message in context: http://n4.nabble.com/test-the-goodness-of-it-for-negative-binomial-type-2-tp1575892p1585357.html Sent from the R help mailing list archive at Nabble.com. __

[R] test the goodness of it for negative binomial type 2

2010-03-02 Thread casperyc
[code]library(MASS) x=c(rep(0,8096), rep(1,1629), rep(2,233), rep(3,38), rep(4,4) ) x.bar=round(mean(x),4) x.var=round(var(x),4) p.hat=round(x.bar/x.var,4) alpha.hat=round(x.bar*p.hat/(1-p.hat),4) fitdistr(x, Negative Binomial) fitdistr(x,