pwrss.z.poisreg | R Documentation |
Calculates statistical power or minimum required sample size (only one can be NULL at a time) to test a single coefficient in poisson regression. pwrss.z.poisson()
and pwrss.z.poisreg()
are the same functions. 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.
pwrss.z.poisreg(exp.beta0 = 1.10, exp.beta1 = 1.16,
beta0 = log(exp.beta0), beta1 = log(exp.beta1),
mean.exposure = 1, n = NULL, power = NULL, r2.other.x = 0,
alpha = 0.05, alternative = c("not equal", "less", "greater"),
method = c("demidenko(vc)", "demidenko", "signorini"),
distribution = "normal", verbose = TRUE)
pwrss.z.poisson(exp.beta0 = 1.10, exp.beta1 = 1.16,
beta0 = log(exp.beta0), beta1 = log(exp.beta1),
mean.exposure = 1, n = NULL, power = NULL, r2.other.x = 0,
alpha = 0.05, alternative = c("not equal", "less", "greater"),
method = c("demidenko(vc)", "demidenko", "signorini"),
distribution = "normal", verbose = TRUE)
exp.beta0 |
the base mean event rate |
exp.beta1 |
event rate ratio: the relative increase in the mean event rate for one unit increase in the predictor X (similiar to odds ratio in logistic regression) |
beta0 |
|
beta1 |
|
mean.exposure |
the mean exposure time (should be > 0). Usually 1 |
n |
total sample size |
power |
statistical power |
r2.other.x |
proportion of variance in the predictor X explained by other covariates. Not to be confused with the pseudo R-squared |
alpha |
probability of type I error |
alternative |
direction or type of the hypothesis test: "not equal", "greater", "less" |
method |
calculation method. |
distribution |
distribution family. Can be one of the |
verbose |
if |
parms |
list of parameters used in calculation |
test |
type of the statistical test (z test) |
ncp |
non-centrality parameter |
power |
statistical power |
n |
total sample size |
Demidenko, E. (2007). Sample size determination for logistic regression revisited. Statistics in Medicine, 26(18), 3385-3397.
Hsieh, F. Y., Bloch, D. A., & Larsen, M. D. (1998). A simple method of sample size calculation for linear and logistic regression. Statistics in Medicine, 17(4), 1623-1634.
Signorini, D. F. (1991). Sample size for poisson regression. Biometrika, 78(2), 446-450.
# predictor X follows normal distribution
## regression coefficient specification
pwrss.z.poisreg(beta0 = 0.50, beta1 = -0.10,
alpha = 0.05, power = 0.80,
dist = "normal")
## rate ratio specification
pwrss.z.poisreg(exp.beta0 = exp(0.50),
exp.beta1 = 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)
pwrss.z.poisreg(exp.beta0 = exp(0.50),
exp.beta1 = 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
pwrss.z.poisreg(beta0 = 0.50, beta1 = -0.10,
alpha = 0.05, power = 0.80,
dist = "bernoulli")
## rate ratio specification
pwrss.z.poisreg(exp.beta0 = exp(0.50),
exp.beta1 = 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)
pwrss.z.poisreg(exp.beta0 = exp(0.50),
exp.beta1 = 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.