adjust_uc {multibias} | R Documentation |
Adust for uncontrolled confounding.
Description
adjust_uc
returns the exposure-outcome odds ratio and confidence
interval, adjusted for uncontrolled confounding from a binary confounder.
Usage
adjust_uc(
data,
exposure,
outcome,
confounders = NULL,
u_model_coefs,
level = 0.95
)
Arguments
data |
Dataframe for analysis. |
exposure |
String name of the exposure variable. |
outcome |
String name of the outcome variable. |
confounders |
String name(s) of the confounder(s). A maximum of three confounders are allowed. |
u_model_coefs |
The regression coefficients corresponding to the model: logit(P(U=1)) = α0 + α1X + α2Y + α2+jCj, where U is the binary unmeasured confounder, X is the exposure, Y is the outcome, C represents the vector of measured confounders (if any), and j corresponds to the number of measured confounders. The number of parameters therefore equals 3 + j. |
level |
Value from 0-1 representing the full range of the confidence interval. Default is 0.95. |
Details
Values for the regression coefficients can be applied as
fixed values or as single draws from a probability
distribution (ex: rnorm(1, mean = 2, sd = 1)
). The latter has
the advantage of allowing the researcher to capture the uncertainty
in the bias parameter estimates. To incorporate this uncertainty in the
estimate and confidence interval, this function should be run in loop across
bootstrap samples of the dataframe for analysis. The estimate and
confidence interval would then be obtained from the median and quantiles
of the distribution of odds ratio estimates.
Value
A list where the first item is the odds ratio estimate of the effect of the exposure on the outcome and the second item is the confidence interval as the vector: (lower bound, upper bound).
Examples
adjust_uc(
evans,
exposure = "SMK",
outcome = "CHD",
confounders = "HPT",
u_model_coefs = c(qlogis(0.25), log(0.5), log(2.5), log(2)),
)