0

I've got this problem using GoFStat under the fitdistrplus package in R. Here's my code:

col = c(2,2,3,2,2,2,2,3,4,3,1,4)

fw = fitdist(col, "weibull", lower = c(0,0))
fg = fitdist(col, "gamma", lower = c(0,0))
fln = fitdist(col, "lnorm")

ddlist = list(
  fw,
  fln,
  fg
)

gofstat(ddlist)

It gives the error:

Error in ans[!test & ok] <- rep(no, length.out = length(ans))[!test & : replacement has length zero In addition: Warning message: In rep(no, length.out = length(ans)) : 'x' is NULL so the result will be NULL

Any help? Am I doing something dumb?

Thanks

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
Tim
  • 1
  • 2
  • Try with a different `col` vector, like: `set.seed(1); col = rbinom(10,4, 0.3)+1`: the code works. This proves that the problem is in your data, not in the code. – Marco Sandri Aug 07 '17 at 08:10
  • Ahh I see, the data I have been using was actually wrong. Thanks for the help. – Tim Aug 07 '17 at 21:27

0 Answers0