Learn R Programming

PSAboot (version 1.0)

PSAboot: Bootstraping for propensity score analysis

Description

Bootstrapping has become a popular resampling method for estimating sampling distributions. And propensity score analysis (PSA) has become popular for estimating causal effects in observational studies. This function implements bootstrapping specifically for PSA. Like typical bootstrapping methods, this function estiamtes treatment effects for M random samples. However, unlike typical bootstrap methods, this function allows for separate sample sizes for treatment and control units. That is, under certain circumstances (e.g. when the ratio of treatment-to-control units is large) bootstrapping only the control units may be desirable. Additionally, this function provides a framework to use multiple PSA methods for each bootstrap sample.

Usage

PSAboot(Tr, Y, X, M = 100, formu =
    as.formula(paste0("treat ~ ", paste0(names(X), collapse
    = " + "))), control.ratio = 5, control.sample.size =
    min(control.ratio * min(table(Tr)), max(table(Tr))),
    control.replace = TRUE, treated.sample.size =
    min(table(Tr)), treated.replace = TRUE, methods =
    c(Stratification = boot.strata, ctree = boot.ctree,
    rpart = boot.rpart, Matching = boot.matching, MatchIt =
    boot.matchit), parallel = TRUE, seed = NULL, ...)

Arguments

Tr
numeric (0 or 1) or logical vector of treatment indicators.
Y
vector of outcome varaible.
X
matrix or data frame of covariates used to estimate the propensity scores.
M
number of bootstrap samples to generate.
formu
formula used for estimating propensity scores. The default is to use all covariates in X.
control.ratio
the ratio of control units to sample relative to the treatment units.
control.sample.size
the size of each bootstrap sample of control units.
control.replace
whether to use replacement when sampling from control units.
treated.sample.size
the size of each bootstrap sample of treatment units. The default uses all treatment units for each boostrap sample.
treated.replace
whether to use replacement when sampling from treated units.
methods
a named vector of functions for each PSA method to use.
seed
random seed. Each iteration, i, will use a seed of seed + i.
parallel
whether to run the bootstrap samples in parallel.
...
other parameters passed to Match and psa.strata

Value

  • a list with following elements: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]