This function tests if the Poisson model is appropriate by simulating replicate datasets under the Poisson assumption and comparing the overdispersion parameter estimates with those obtained from the Negative Binomial (NB) model fit to the original data.
assess_NB(
x,
stochastic = FALSE,
numRep = 100,
cutoff = 0.05,
plot = TRUE,
verbose = TRUE
)A list containing:
Logical scalar, TRUE if NB model should be kept (data shows overdispersion). If FALSE, birp should be re-run using the Poisson model to gain power.
Logical vector indicating whether NB should be kept for each method.
Numeric vector with fractions of replicates where Poisson simulated overdispersion exceeded observed NB overdispersion.
Matrix of overdispersion parameter estimates from Poisson-simulated replicates.
Numeric vector of overdispersion parameter estimates from the original NB fit.
A birp object estimated under a negative binomial model.
Logical; if TRUE, use a stochastic trend model, otherwise deterministic (default).
Integer; number of replicate datasets to simulate (default 100).
Numeric; significance threshold for the fraction of replicates where NB overdispersion exceeds Poisson estimate (default 0.05).
Logical; if TRUE, plot the distributions of overdispersion parameters from simulated Poisson replicates (default TRUE).
Logical; if FALSE, suppress console output (default TRUE).
data <- simulate_birp()
est <- birp(data, negativeBinomial = TRUE)
res_assess <- assess_NB(est, numRep = 5)
Run the code above in your browser using DataLab