[R] Fitdistrplus package : Error messages

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Wed May 29 11:54:57 CEST 2019


Hello,

This is because you have non-integer values in vector x?


This one works.

##Poisson distribution
f2p <- fitdist(floor(x), "pois")
plot(f2p)
summary(f2p)


Not so well

##negative binomial distribution
f2n <- fitdist(floor(x), "nbinom")
f2n <- fitdist(ceiling(x), "nbinom")
f2n <- fitdist(round(x), "nbinom")

plot(f2n)
summary(f2n)


Hope this helps,

Rui Barradas

Às 09:46 de 29/05/19, varin sacha via R-help escreveu:
> Dear R-Experts,
> 
> Here is a toy example, reproducible example, I get error messages. I have tried to fix it by myself using "google is my friend", but I did not get it. If somebody can help me to fix these errors, would be highly appreciated.
> 
> ##########################
> install.packages("fitdistrplus")
> library(fitdistrplus)
> 
> x=c(3,3.5,4.5,5,5.5,5.5,4.5,3.5,5,6,3,4,5,4.5,4,5.5,3.5,3,3)
> 
> ##Poisson distribution
> f2p=fitdist(x, "pois")
> plot(f2p)
> summary(f2p)
> 
> ##negative binomial distribution
> f2n=fitdist(x,"nbinom")
> plot(f2n)
> summary(f2n)
> ####################################
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list