Learn R Programming

inferference (version 0.4.61)

interference: Estimate Causal Effects in presence of interference

Description

Estimate Causal Effects in presence of interference

Usage

interference(formula, propensity_integrand = "logit_integrand",
  loglihood_integrand = propensity_integrand, allocations, data,
  model_method = "glmer", model_options = list(family = binomial(link =
  "logit")), causal_estimation_method = "ipw",
  causal_estimation_options = list(set_NA_to_0 = TRUE, variance_estimation =
  "robust"), conf.level = 0.95, rescale.factor = 1, ...)

Arguments

formula
The formula used to define the causal model. Has a minimum of 4 parts, separated by | and ~ in a specific structure: outcome | exposure ~ propensity covariates | group. The order matters, and the pipes split the dat
propensity_integrand
A function, which may be created by the user, used to compute the IP weights. This defaults to logit_integrand, which calculates the product of inverse logits for individuals in a group: $\prod_{j = 1}^{n_i} {r \times h_{ij}(b_i)^{A_{ij}}}{1
loglihood_integrand
A function, which may be created by the user, that defines the log likelihood of the logit model used for robust variance estimation. Generally, this will be the same function as propensity_integrand. Indeed, this is the default.
allocations
a vector of values in [0, 1]. Increasing the number of elements of the allocation vector greatly increases computation time; however, a larger number of allocations will make plots look nicer. A minimum of two allocations is required.
data
the analysis data frame. This must include all the variables defined in the formula.
model_method
the method used to estimate or set the propensity model parameters. Must be one of 'glm', 'glmer', or 'oracle'. Defaults to 'glmer'. For a fixed effects only model use 'glm', and to include
model_options
a list of options passed to the function in model_method. Defaults to list(family = binomial(link = 'logit')). When model_method = 'oracle', the list must have two elements fixed.effects and random
causal_estimation_method
currently only supports 'ipw'.
causal_estimation_options
A list with two slots. (1) variance_estimation is either 'simple' or 'robust'. See details. Defaults to 'robust'. (2) is set_NA_to_0. Defaults to TRUE. When, for example, group
conf.level
level for confidence intervals. Defaults to 0.95.
rescale.factor
a scalar multiplication factor by which to rescale outcomes and effects. Defaults to 1.
...
Used to pass additional arguments to internal functions such as numDeriv::grad() or integrate(). Additionally, arguments can be passed to the propensity_integrand and loglihood_integrand functions.

Value

  • Returns a list of overall and group-level IPW point estimates, overall and group-level IPW point estimates (using the weight derivatives), derivatives of the loglihood, the computed weight matrix, the computed weight derivative array, and a summary.

Details

The following formula includes a random effect for the group: outcome | exposure ~ propensity covariates + (1|group) | group. In this instance, the group variable appears twice. If the study design includes a "participation" variable, this is easily added to the formula: outcome | exposure | participation ~ propensity covariates | group.

logit_integrand has two options that can be passed via the ... argument:

  • randomization: a scalar. This is the$r$in the formula just above. It defaults to 1 in the case that aparticipationvector is not included. The vaccine study example demonstrates use of this argument.
  • integrate_allocation:TRUE/FALSE. When group sizes grow large (over 1000), the product term oflogit_integrandtends quickly to 0. When set toTRUE, the IP weights tend less quickly to 0. Defaults toFALSE.

If the true propensity model is known (e.g. in simulations) use variance_estimatation = 'simple'; otherwise, use the default variance_estimatation = 'simple'. Refer to the web appendix of http://dx.doi.org/10.1111/biom.12184{Heydrich-Perez et al. (2014)} for complete details.