cil: Treatment effect estimation for linear models via Confounder...

View source: R/cil.R

cilR Documentation

Treatment effect estimation for linear models via Confounder Importance Learning using non-local priors.

Description

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.

Usage

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)

Arguments

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 y

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 y

I

matrix with the desired interaction terms between D and X. If not informed, i.e. supplied as the default NULL, this term will not be included into the response model

family

Distribution of the outcome, e.g. 'normal', 'binomial' or 'poisson'. See help(modelSelection) for a full list of options

familyD

Distribution of the treatment(s). Only 'normal' or 'binomial' currently allowed

R

Number of MCMC iterations to be run by modelSelection on each stage of CIL (see argument niter therein)

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: EB (Empirical Bayes, based on maximum marginal likelihood) and EP (Expectation propagation approximation)

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), lasso (see argument lpen), lasso_bic (default), and ridge)

th.prior

prior associated to the thetas for the Empirical Bayes estimation. Currently only unif (Uniform prior) is supported, effectively making the EB approach the maximisation of the marginal likelihood

priorCoef

Prior on the response model parameters, see modelSelection

rho.min

value of \rho in (0, 1/2) employed in the prior probability model of CIL. If left uninformed, i.e. supplied as the default NULL, it will be set to 1/p^2, where p is the dimension of the response model.

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 Inf all visited models by the enumeration/MCMC are considered, but it might be computationally desirable to restrict this number when the dimension of D and/or X is large

lpen

penalty type supplied to glmnet if mod1 is set to lasso. Default is lambda.1se (see documentation corresponding to glmnet for options on how to set this parameter)

eps

small scalar used to avoid round-offs to absolute zeroes or ones in marginal prior inclusion probabilities.

bvs.fit0

object returned by modelSelection under \theta = 0, used as a model exploration tool to compute EB approximation on the thetas. This argument is only supposed to be used in case of a second computation the model on the same data where th.search has ben changed to EB, in order to avoid repeating the computation of the initial modelSelection fit. To use this argument, supply the object residing in the slot init.msfit of a cilfit-class object.

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 th.search has ben changed to EB, in order to save the cost of the EP search to initialise the optimisation algorithm. To use this argument, supply the object residing int the slot th.hat of a cilfit-class object.

center

If TRUE, y and x are centered to have zero mean. Dummy variables corresponding to factors are NOT centered

scale

If TRUE, y and columns in x are scaled to have variance=1. Dummy variables corresponding to factors are NOT scaled

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 verbose==TRUE to print iteration progress

Details

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.

Value

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 D

coef

BMA inference for treatment effects and all other covariates

model.postprobs

matrix returning the posterior model probabilities computed in the CIL model

margpp

numeric vector containing the estimated marginal posterior inclusion probabilities of the featured treatments and controls

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 th.search specified

treat.coefs

Estimated weights of the effect of the control variables on each of the treatments, as estimated with the method specified in argument mod1

msfit

Object returned by modelSelection (of class msfit) of the final model estimated by CIL.

theta.EP

Estimated values of theta using the EP algorithm. It coincides with theta.hat if the argument th.search is set to EB

init.msfit

Initial msfit object used to estimate the inital model where all elements in theta are set to zero (used in the optimisation process of this hyper-parameter)

Author(s)

Miquel Torrens

References

Torrens i Dinares M., Papaspiliopoulos O., Rossell D. Confounder importance learning for treatment effect inference. https://arxiv.org/abs/2110.00314, 2021, 1–48.

See Also

postProb to obtain posterior model probabilities.

coef for inference on the treatment parameters.

Examples

# 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)


mombf documentation built on Sept. 28, 2023, 5:06 p.m.