chisq_count: Chi-sq test of a count distribution

Description Usage Arguments Examples

View source: R/chisq_count.R

Description

Performs a chi-squared test of a count distribution against a vector of probabilities calculated via a monte carlo simulation of distributions under the null hypothesis of poisson or negative binomial expected counts.

Usage

1
chisq_count(x, data = NULL, B = 500, family = c("poisson", "nbinom"))

Arguments

x

a vector of count data or a name of a count data column in data

data

a data frame

B

nuber of replicates for simulating the distributions and for calculating the p-value of the chi-squared test if any expected counts are fewer than 5.

family

families for the null hypothesis

Examples

1
2
3
4
5
chisq_count(testdata$extortions, family = "poisson")

# batch using \code{\link{chisq_tb}}
lx <- lapply(c("extortions", "bribes"), chisq_count, testdata, B = 2000, family = "poisson")
chisq_tb(lx, stars = TRUE)

prestevez/estevez documentation built on Jan. 31, 2020, 12:31 a.m.