bac {bacr} | R Documentation |

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

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

`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 |

`familyY` |
the family of the outcome model. Currently, it allows |

`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 |

`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. |

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.

a list variable, which contains

`data` |
a data from containing the input data. |

`MX` |
a matrix of MCMC samples of exposure models. |

`MY` |
a matrix of MCMC samples of outcome models. |

`models` |
a list variable containing unique outcome models in the MCMC sample and the appearence frequencies. |

`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. |

`predictorsY` |
All the possible predictors of the outcome. |

`ACE` |
a vector of MCMC samples of the ACE. |

`para` |
a list of model parameters |

Chi Wang

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.*

[Package *bacr* version 1.0.1 Index]