| cil | R Documentation |
Treatment effect estimation for linear models in the presence of
multiple treatments and a potentially high-dimensional number of controls,
i.e. p \gg n can be handled.
Confounder Importance Learning (CIL) proposes an estimation framework where the importance of the relationship between treatments and controls is factored in into the establishment of prior inclusion probabilities for each of these controls on the response model. This is combined with the use of non-local priors to obtain BMA estimates and posterior model probabilities.
cil is built on modelSelection and produces objects of type
cilfit. Use coef and postProb to obtain treatment effect
point estimates and posterior model probabilities, respectively, on this
object class.
cil(y, D, X, I = NULL, family = 'normal', familyD = 'normal',
R = 1e4, Rinit = 500, th.search = 'EB', mod1 = 'lasso_bic',
th.prior = 'unif', priorCoef = momprior(taustd=1),
rho.min = NULL, rho.max = 0.95,
th.range = NULL, max.mod = 2^20, lpen = 'lambda.1se',
eps = 1e-10, bvs.fit0 = NULL, th.EP = NULL, center = TRUE, scale =
TRUE, includevars, verbose = TRUE)
y |
one-column matrix containing the observed responses. The response must be continuous (currently the only type supported) |
D |
treatment matrix with numeric columns, continuous or discrete. Any finite
number of treatments are supported. If only one treatment is provided, supply
this object in the same format used for |
X |
matrix of controls with numeric columns, continuous or discrete. If only
one treatment is provided, supply this object in the same format used for |
I |
matrix with the desired interaction terms between |
family |
Distribution of the outcome, e.g. 'normal', 'binomial' or
'poisson'. See |
familyD |
Distribution of the treatment(s). Only 'normal' or 'binomial' currently allowed |
R |
Number of MCMC iterations to be
run by |
Rinit |
MCMC iterations to estimate marginal posterior inclusion probabilities under a uniform model prior, needed for EP |
th.search |
method to estimate theta values in the marginal prior inclusion
probabilities of the CIL model. Options are: |
mod1 |
method to estimate the feature parameters corresponding to the
influence of the controls on the treatments. Supported values for this
argument are 'ginv' (generalised pseudo-inverse), |
th.prior |
prior associated to the thetas for the Empirical Bayes
estimation. Currently only |
priorCoef |
Prior on the response model parameters, see |
rho.min |
Lower bound on the covariate's prior inclusion probability.
By default, it is set to |
rho.max |
Upper bound on the covariate's prior inclusion probability |
th.range |
sequence of values to be considered in the grid when searching for points to initialise the search for the optimal theta parameters. If left uninformed, the function will determine a computationally suitable grid depending on the number of parameters to be estimated |
max.mod |
Maximum number of models considered when computing the marginal
likelihood required by empirical Bayes.
If set to |
lpen |
penalty type supplied to |
eps |
small scalar used to avoid round-offs to absolute zeroes or ones in marginal prior inclusion probabilities. |
bvs.fit0 |
object returned by |
th.EP |
Optimal theta values under the EP approximation, obtained in a
previous CIL run. This argument is only supposed to be used in case of
a second computation the model on the same data where |
center |
If |
scale |
If |
includevars |
Logical vector of length ncol(x) indicating variables that should always be included in the model, i.e. variable selection is not performed for these variables |
verbose |
Set |
We estimate treatment effects for the features present in the treatment
matrix D. Features in X, which may or may not be causal
factors of the treatments of interest, only act as controls and, therefore,
are not used as inferential subjects.
Confounder importance learning learns from data the amount of confounding in the data, based on a so-called confounding coefficient, and uses this to set covariate prior inclusion probabilities. Roughly, the coefficient measures to what extend covariates that are truly related to the outcome are also truly related (high confounding) or not related (no confounding) to the treatment(s).
In high confounding, covariates in X that appear to be related
to D are assigned high inclusion probability in the regression
for y. In low confounding, they're assigned low prior inclusion
probability. See function plotprior to visualize these prior
probabilities.
Prior probabilities are regulated through a hyper-parameter theta that
is set according to the method supplied to th.search.
While the EB option obtains a more precise estimate,
particularly when there are many covariates in X, the
EP is much faster computationally and typically gives very
similar results.
See references for further details on implementation and computation.
Object of class cilfit, which extends a list with elements
cil.teff |
BMA estimates, 0.95 intervals and posterior inclusion
probabilities for treatment effects in |
coef |
BMA inference for treatment effects and all other covariates |
model.postprobs |
|
margpp |
|
margprior |
Marginal prior inclusion probabilities, as estimated by CIL |
margpp.unif |
Marginal posterior inclusion probabilities that would be obtained under a uniform model prior |
theta.hat |
Values used for the hyper-parameter theta, estimated according
to the argument |
treat.coefs |
Estimated weights of the effect of the control variables
on each of the treatments, as estimated with the method specified in argument
|
msfit |
Object returned by |
theta.EP |
Estimated values of theta using the EP algorithm. It coincides
with |
init.msfit |
Initial |
Miquel Torrens
Torrens i Dinares M., Papaspiliopoulos O., Rossell D. Confounder importance learning for treatment effect inference. https://arxiv.org/abs/2110.00314, 2021, 1–48.
postProb to obtain posterior model probabilities.
coef for inference on the treatment parameters.
plotprior to plot the estimated prior probabilities, as a
function of
# Simulate data
set.seed(1)
X <- matrix(rnorm(100 * 50), nrow = 100, ncol = 50)
beta_y <- matrix(c(rep(1, 6), rep(0, 44)), ncol = 1)
beta_d <- matrix(c(rep(1, 6), rep(0, 44)), ncol = 1)
alpha <- 1
d <- X %*% beta_d + rnorm(100)
y <- d * alpha + X %*% beta_y + rnorm(100)
# Confounder Importance Learning
fit1 <- cil(y = y, D = d, X = X, th.search = 'EP')
# BMA for treatment effects
coef(fit1)
# BMA for all covariates
head(fit1$coef)
# Estimated prior inclusion prob
# vs. treatment regression coefficients
plotprior(fit1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.