BootVar: Bootstrap variance of potential outcomes.

View source: R/BootVar_function.R

BootVarR Documentation

Bootstrap variance of potential outcomes.

Description

Using re-sampling of clusters to acquire an estimate of the potential outcome estimator variance.

Usage

BootVar(
  dta,
  B = 500,
  alpha,
  ps = c("true", "est"),
  cov_cols,
  phi_hat_true = NULL,
  ps_info_est = NULL,
  verbose = TRUE,
  ps_specs = NULL,
  trt_col = NULL,
  out_col = NULL,
  return_everything = FALSE
)

Arguments

dta

The data frame including the observed data set.

B

Number of bootstrap samples.

alpha

The values of alpha where the potential outcomes are estimated.

ps

Character. Whether the propensity score is known or is estimated. Options include 'true', 'est'. Defaults to 'true'.

cov_cols

Vector of column indices of the covariates used in the propensity score model.

phi_hat_true

List. Specify if the propensity score is known (ps set to 'true'). Elements of the list are trt_coef and re_var including the coefficients of the propensity score and random effect variance.

ps_info_est

List of elements for acquiring estimates based on the estimated propensity score. The list includes 1) glm_form: Element of formula class. The formula can be either for a fixed effects model or for a model including random intercepts. 2) ps_with_re: An indicator of whether the propensity score is a mixed model (set to TRUE) or not (set to FALSE). 3) gamma_numer: The coefficients of the covariates in the counterfactual treatment allocation model, and 4) use_control: Set to TRUE or FALSE if you want or do not want additional elements in fitting the mixed model. use_control does not have to be specified.

verbose

Logical. Whether progress is printed. Defaults to TRUE.

trt_col

If the treatment is not named 'A' in dta, specify the treatment column index.

out_col

If the outcome is not named 'Y', specify the outcome column index.

return_everything

Logical. Defaults to FALSE. If set to FALSE, bootstrap estimates of the population average potential outcomes for all values of alpha will be returned. If set to TRUE, additional information will be returned including the chosen clusters at every bootstrap sample, the group-specific estimated average potential outcome, and the random effect variance of the cluster specific intercept.


gpapadog/Interference documentation built on Oct. 30, 2022, 9:20 p.m.