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, rho.min = NULL,
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 |
value of |
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 is a flexible treatment effect estimation
framework that essentially determines how the role of the influence of
X
on D
should affect their relationship with the response,
through establishing prior inclusion probabilities on the response model
for y
according to said role. This is 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
a priori, the EP
alternative achieves a reasonable approximation at a
fraction of the computational cost.
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.
# 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.