sim_power_nbinom: Empirical Power for Negative Binomial Comparison
Description
Estimates empirical power to detect a relative risk either above or below a specified boundary,
depending on the direction of the alternative hypothesis. Simulates count data with over dispersion,
fits a model with glm.nb, and evaluates the power to reject the null
hypothesis using a negative binomial model.
An S3 object of class empirical_power_result, which contains
the estimated empirical power and its confidence interval. The object can
be printed, formatted, or further processed using associated S3 methods.
See also empirical_power_result.
Arguments
n1
Integer. Number of participants in group 1.
n2
Integer. Number of participants in group 2.
ir1
Numeric. Incidence rate in group 1.
tm
Numeric. Average exposure time per subject (assumed equal across subjects).
rr
Numeric. True relative risk between groups (group 2 rate = rr × group 1 rate).
boundary
Numeric. Relative risk boundary under the null hypothesis.
dispersion
Numeric. Dispersion parameter (\(\phi\)) for the negative binomial distribution.
alpha
Numeric. Type I error rate (two-sided).
nsim
Integer. Number of simulation iterations.
conf.level
Numeric. Confidence level for the empirical power estimate