R/Estimator.R
policyFX.Rd
This function implements the estimators from Barkley et al. (2017) for estimating causal effects ("FX") of treatment policies from an observational study when clustered interference is assumed. Clustered interference is also often known as "partial" interference. For the manuscript introducing the methods in clusteredinterference, see: URL https://arxiv.org/abs/1711.04834
policyFX(data, formula, alphas, k_samps = NULL, ..., verbose = FALSE, root_options = NULL, nAGQ = 2, return_matrices = FALSE)
data | A |
---|---|
formula | The |
alphas | A numeric vector for the probabilities corresponding to the policies of interest. Each entry must be between 0 and 1. |
k_samps | The maximum number of vectors to evaluate to estimate the counterfactual probabilities (i.e., \(\omega(A,N,\alpha)\)). Setting to 0 avoids approximation at the cost of increased computation time. Recommended to set <= 5. |
... | The dots argument. The user may supply their own
|
verbose | A Boolean on whether to print output to |
root_options | These are passed to |
nAGQ | This is the number of Adaptive Gaussian Quadrature points used in
the |
return_matrices | A Boolean on whether to return the "bread" and "meat"
matrices in the sandwich variance. Defaults to |
A list
object including:
estimates
: A
tidy data.frame
with columns estimand
, estimate
,
var
, se
, LCI
and UCI
for 95% CI's, and more
information.
parameters
: An untidy list
of the point
estimates of all (target and nuisance) parameters.
variance_matrices
: When return_matrices
is TRUE
this
is a list
object for the "bread" and "meat" matrices in the sandwich
variance calculations for each estimand. Otherwise, it is a list
object with length 0.
propensity_scores
: The estimated
propensity scores for each cluster.
model
: The treatment model
object.
formula
: The full formula argument provided, after
coercion to a Formula
object
These estimators are based on inverse probability-weighting by the propensity score for treatment (IPW) to estimate causal effects of counterfactual policies of interest (i.e., "policy effects") when clustered interference is assumed. The policies of interest correspond to counterfactual scenarios in which treatment may be correlated within clusters.
This method estimates causal contrasts of these policies by estimating the counterfactual treatment probabilities; taking the correlation structures into account requires heavy computational resources, so the user should be patient.
The modeling formula for the propensity score (i.e., treatment) model is
specified via the formula
formal argument. An example of a model
logit-linear fixed effects would be Y | A ~ X1 + X2 + (1 |
cluster_ID) | cluster_ID
. A similar model that also includes an
interaction term is Y | A ~ X1 + X2 + X1:X2 + (1 | cluster_ID) |
cluster_ID
.
Barkley, B. G., Hudgens, M. G., Clemens, J. D., Ali, M., and Emch, M. E. (2017). Causal Inference from Observational Studies with Clustered Interference. arXiv preprint arXiv:1711.04834. (URL: https://arxiv.org/abs/1711.04834.)
Bradley C Saul and Michael G Hudgens (2017). A Recipe for
inferference
: Start with Causal Inference. Add Interference. Mix
Well with R. Journal of Statistical Software 82(2), pp.
1-21. doi: <10.18637/jss.v082.i02> (URL:
http://doi.org/10.18637/jss.v082.i02).
https://cran.r-project.org/package=inferference.
https://github.com/bsaul/inferference.
Bradley Saul (2017). geex
: An API for M-Estimation.
https://cran.r-project.org/package=geex.
https://github.com/bsaul/geex.
Please see the main package vignette at
vignette("estimate-policyFX")
. It describes the necessary arguments,
as well as some extra functionality.
# NOT RUN { toy_data <- clusteredinterference::toy_data causal_fx <- policyFX( data = toy_data, formula = Outcome | Treatment ~ Age + Distance + (1 | Cluster_ID) | Cluster_ID, alphas = c(.3, .5), k_samps = 1, verbose = FALSE ) # }