y_rnorm(60,mean=-1,sd=2) y hist(y) chisq.gof(y,dist="norm",mean=-1,sd=2) mean(y) sqrt(var(y)) chisq.gof(y,dist="norm",mean=mean(y),sd=sqrt(var(y))) chisq.gof(y,dist="norm",n.param.est=2,mean=mean(y),sd=sqrt(var(y))) x_rbinom(20,size=5,prob=1/2) x table(x) cut_quantile(x) cut table(cut(x,cut)) chisq.gof(x,cut.points=cut,dist="binom",size=5,prob=1/2) cut[1]_cut[1]-1 cut[4]_cut[4]+1 cut[5]_cut[5]+1 cut table(cut(x,cut)) chisq.gof(x,cut.points=cut,dist="binom",size=5,prob=1/2)$e chisq.gof(x,cut.points=cut,dist="binom",size=5,prob=1/2) x_rep(0:7,c(89,143,94,42,20,8,3,1)) x table(x) cut_c(0:7) table(cut(x,cut)) cut_c(-1:7) table(cut(x,cut)) chisq.gof(x,cut.points=cut,n.param.est=1,dist="pois",lambda=mean(x))$e chisq.gof(x,cut.points=cut,n.param.est=1,dist="pois",lambda=mean(x))$c cut_c(-1:4,7) table(cut(x,cut)) chisq.gof(x,cut.points=cut,n.param.est=1,dist="pois",lambda=mean(x))$e chisq.gof(x,cut.points=cut,n.param.est=1,dist="pois",lambda=mean(x))