printRR {logisticRR} | R Documentation |
Print adjusted relative risk under binary or ordinal exposure variable.
Description
Print adjusted relative risk under binary or ordinal exposure variable.
Usage
printRR(formula, basecov = 0, fixcov = NULL, data)
Arguments
formula |
a formula term that is passed into |
basecov |
a baseline value of exposure variable. Defaults to |
fixcov |
a data frame of fixed value for each of adjusted confounders. If there is no confounder other than an exposure variable of interest, |
data |
a data frame containing response variable and all the terms used in |
Value
fit |
an object of class |
RR |
(adjusted) relative risk in response under exposure at baseline ( |
delta.var |
estimated variance of relative risk ( |
fix.cov |
a data frame of fixed value for each of adjsuted confounders. |
Examples
n <- 500
set.seed(1234)
X <- rbinom(n, 1, 0.3)
W <- rbinom(n, 1, 0.3)
W[sample(1:n, n/3)] = 2
Y <- rbinom(n, 1, plogis(X - W))
dat <- as.data.frame(cbind(Y, X, W))
result <- printRR(Y ~ X + W, basecov = 0, data = dat)