power.z.poisson | R Documentation |
Calculates power or sample size (only one can be NULL at a time) to test a single coefficient in poisson regression. power.z.poisson()
and power.z.poisreg()
are the same functions, as well as pwrss.z.poisson()
and pwrss.z.poisreg()
. The distribution of the predictor variable can be one of the following: c("normal", "poisson", "uniform", "exponential", "binomial", "bernouilli", "lognormal")
. The default parameters for these distributions are
distribution = list(dist = "normal", mean = 0, sd = 1)
distribution = list(dist = "poisson", lambda = 1)
distribution = list(dist = "uniform", min = 0, max = 1)
distribution = list(dist = "exponential", rate = 1)
distribution = list(dist = "binomial", size = 1, prob = 0.50)
distribution = list(dist = "bernoulli", prob = 0.50)
distribution = list(dist = "lognormal", meanlog = 0, sdlog = 1)
Parameters defined in list()
form can be modified, but the names should be kept the same. It is sufficient to use distribution's name for default parameters (e.g. dist = "normal"
).
Formulas are validated using Monte Carlo simulation, G*Power, and tables in PASS documentation.
NOTE: The pwrss.z.poisson()
and its alias pwrss.z.poisreg()
are deprecated. However, they will remain available as wrappers for the power.z.logistic()
function.
power.z.poisson(base.rate = NULL, rate.ratio = NULL,
beta0 = log(base.rate), beta1 = log(rate.ratio),
n = NULL, power = NULL,
r.squared.predictor = 0, mean.exposure = 1,
alpha = 0.05, alternative = c("two.sided", "one.sided"),
method = c("demidenko(vc)", "demidenko", "signorini"),
distribution = "normal", ceiling = TRUE,
verbose = TRUE, pretty = FALSE)
base.rate |
the base mean event rate. |
rate.ratio |
event rate ratio. The relative increase in the mean event rate for one unit increase in the predictor (similar to odds ratio in logistic regression). |
beta0 |
|
beta1 |
|
mean.exposure |
the mean exposure time (should be > 0). Usually 1 |
n |
integer; sample size. |
power |
statistical power, defined as the probability of correctly rejecting a false null hypothesis, denoted as |
r.squared.predictor |
proportion of variance in the predictor accounted for by other covariates. This is not a pseudo R-squared. To compute it, regress the predictor on the covariates and extract the adjusted R-squared from that model. |
alpha |
type 1 error rate, defined as the probability of incorrectly rejecting a true null hypothesis, denoted as |
alternative |
character; direction or type of the hypothesis test: "not equal", "greater", "less". |
method |
character; calculation method. |
distribution |
character; distribution family. Can be one of the |
ceiling |
logical; whether sample size should be rounded up. |
verbose |
logical; whether the output should be printed on the console. |
pretty |
logical; whether the output should show Unicode characters (if encoding allows for it). |
parms |
list of parameters used in calculation. |
test |
type of the statistical test (Z-Test). |
mean |
mean of the alternative distribution. |
sd |
standard deviation of the alternative distribution. |
null.mean |
mean of the null distribution. |
null.sd |
standard deviation of the null distribution. |
z.alpha |
critical value(s). |
power |
statistical power |
n |
sample size. |
Demidenko, E. (2007). Sample size determination for logistic regression revisited. Statistics in Medicine, 26(18), 3385-3397. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.2771")}
Signorini, D. F. (1991). Sample size for poisson regression. Biometrika, 78(2), 446-450.
# predictor X follows normal distribution
## regression coefficient specification
power.z.poisson(beta0 = 0.50, beta1 = -0.10,
alpha = 0.05, power = 0.80,
dist = "normal")
## rate ratio specification
power.z.poisson(base.rate = exp(0.50),
rate.ratio = exp(-0.10),
alpha = 0.05, power = 0.80,
dist = "normal")
## change parameters associated with predictor X
dist.x <- list(dist = "normal", mean = 10, sd = 2)
power.z.poisson(base.rate = exp(0.50),
rate.ratio = exp(-0.10),
alpha = 0.05, power = 0.80,
dist = dist.x)
# predictor X follows Bernoulli distribution (such as treatment/control groups)
## regression coefficient specification
power.z.poisson(beta0 = 0.50, beta1 = -0.10,
alpha = 0.05, power = 0.80,
dist = "bernoulli")
## rate ratio specification
power.z.poisson(base.rate = exp(0.50),
rate.ratio = exp(-0.10),
alpha = 0.05, power = 0.80,
dist = "bernoulli")
## change parameters associatied with predictor X
dist.x <- list(dist = "bernoulli", prob = 0.30)
power.z.poisson(base.rate = exp(0.50),
rate.ratio = exp(-0.10),
alpha = 0.05, power = 0.80,
dist = dist.x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.