Learn R Programming

bacr (version 1.0.1)

bac: Bayesian Adjustment for Confounding (BAC)

Description

Estimating the Average Causal Effect (ACE) based on the BAC algorithm

Usage

bac(data, exposure, outcome, confounders, interactors, familyX, familyY, omega = Inf, num_its, burnM, burnB, thin, population = NULL)

Arguments

data
a data from containing the input data.
exposure
the exposure variable
outcome
the outcome variable
confounders
a vector of potential confounder variable names
interactors
a vector of the names of potential confounders that may interact with the exposure
familyX
the family of the exposure model. Currently, it allows guassian, binomial, and poisson.
familyY
the family of the outcome model. Currently, it allows guassian, binomial, and poisson.
omega
a dependent parameter, which is the prior odds of including a predictor in the outcome model, given that the same predictor is in the exposure model. The default value if Inf, which forces predictors in the exposure model to be included in the outcome model.
num_its
number of MCMC iterations excluding the burn-in iterations.
burnM
number of burn-in iterations when sampling the exposure and outcome models.
burnB
number of burn-in iterations when sampling model coefficients based on a given outcome model.
thin
the thinning parameter when sampling model coefficients based on a given outcome model.
population
the population for which the ACE is based on. It can be either unspecified or a vector of TRUE and FALSE. If unspecified, the function will estimate the ACE for the whole population. If specified, the function will estimate the ACE for the subpopulation defined by the individuals indicated by TRUE.

Value

a list variable, which contains

Details

The function may run slowly for data with large sample size or many potential confounders. The users are suggested to choose small number of iterations first, evaluate the computational speed, then increase the number of iterations. Note that this function assumes a non-informative prior for outcome model coefficients and does not handle informative priors.

References

Wang C, Dominici F, Parmigiani G, Zigler CW. Accounting for Uncertainty in Confounder and Effect Modifier Selection When Estimating Average Causal Effects in Generalized Linear Models. Biometrics, 71(3): 654-665, 2015.

See Also

plot.bacr, summary.bacr