Description Usage Arguments Value Author(s) References Examples
Fits a Bayesian linear outcome and exposure model and performs confounder selection via penalized credible regions (Wilson and Reich 2014).
1 2 3 | BayesPen.lm.confounders(y, x, u, prior, nIter=500, burnIn=100, force,
max.steps = NULL, max.refit, include.me = FALSE,
z.score = FALSE)
|
y |
A n-vector of responses. |
x |
For single exposures this is a n-vector of exposures. For multiple exposures this is a design matrix of the exposures with n rows and one column for each exposure. |
u |
A design matrix with potential confounders and other covariates. An intercept is automatically added. |
prior |
A list specifying the priors for the regression coefficients and the error variance. The four elements of the list are a1, b1, a2, and b2. The residuals are assumed to be iid normal mean 0 with with a gamma(a1,b1) hyperprior on the precision. The regression coeficients are iid mean 0 and have a gamma(a2,b2) hyperprior on the precision. Only one prior can be specified and will be used for both the outcome and exposure models. |
nIter |
The number of MCMC iterations (integer). |
burnIn |
The number of MCMC iterations to be discarded as burnin (integer). |
force |
An optional vector indexing which confounding variables should be forced into the model. This vector indexes the columns of u. All exposures are forced into the model automatically. |
max.steps |
Maximum number of steps to be performed in the LARS algorithm (Hastie and Efron 2013). |
max.refit |
The maximum number of models to be refit. |
include.me |
Indicator for the multiple exposure case indicating if the exposure models should include the other exposures as covariates. |
z.score |
Indicator for using z-scores in the penalty instead of regression coefficients. If the error variance for the exposure and outcome models or the scale of the regression coefficients is very different then using the z-scores make the confounder and exposure components of the weights more comparable. |
joint.path |
A complete solution path for the joint credible regions approach. Each row is a model in the solution path with a 1 indicating a variable is included and a 0 indicating it is not included. |
marginal.path |
Not used for confounder selection. |
order.path |
The action returned from lars that shows when each covariate is added to the model. |
order.marg |
Not used for confounder selection. |
joint |
Always TRUE for confounder selection. |
force |
Vector of variables forced into the model including the exposures. |
coefs |
A matrix of regression coefficients for each model in the solution path. The regression coefficients for parameters omitted from a model are set to 0. |
SSE |
SSE of each refitted model. |
dev |
Deviance of each refitted model. |
df |
Error degrees of freedom from each refitted model. |
lm |
Full fitting of the outcome model. |
confounder.weights |
Confounder weights used in BayesPen to fit the model. |
Ander Wilson, Howard D. Bondell, and Brian J. Reich
Wilson A., Reich B. J. (2014). Confounder selection via penalized credible regions. Biometrics 70: 852-861.
1 2 3 4 | set.seed(1234)
dat <- SimExample(500,model="WPD2")
fit.BRnew <- BayesPen.lm.confounders(y=dat$y,x=dat$X, u=dat$U)
BayesPen.plot(fit.BRnew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.