Learn R Programming

IUPS (version 1.0)

bpsm: Bayesian Propensity Score Matching

Description

A function includes both Bayesian and non-Bayesian methods to incorporate uncertainties in estimated propensity scores and to provide adjusted standard errors for propensity score matching estimators.

Usage

bpsm(Y, t, X, estimand = "ATE", method = "AI", M = 1, L = 1, K = 10000, S = 1000)

Arguments

Y
A vector containing the outcome variable.
t
A vector containing the treatment indicator.
X
A matrix containing the covariates.
estimand
A character string for the estimand. The default is "ATE", average treatment effects. The other option is "ATT", average treatment effects on the treated.
method
A character string for the method to adjust standard errors. The default is "AI", which uses the methods proposed by Abadie and Imbens (2011). "BPSM" invokes the Bayesian methods developed by An (2010). "Both" use both methods.
M
Number of matches requested.
L
Number of within-group matches requested for the AI method.
K
Numbers of iterations. Only needed for BPSM.
S
Number of posterior samples. Only needed for BPSM.

Value

estimates
The estimated treatment effects and their adjusted standard errors. Phat shows the results with unadjusted standard errors. AI shows the results with adjusted standard errors based on the AI method. BP* shows the results with adjusted standard errors based on the Bayesian method.
estimand
A character string indicting the estimand requested.
time
The time elapsed for the computation.
sims
The number of iterations requested for the Bayesian computation, K
posterior
The posterior sample distribution of the treatment effects. BPSM uses the posterior standard deviation to approximate the standard error.

Details

Estimated propensity scores are used to match treated units with untreated units. The function includes two methods to take into account the uncertainties in the estimated propensity scores and to provide adjusted standard errors. The AI method is computationally more efficient but may produce negative standard errors in some cases. In contrast, the BPSM method always provides positive standard errors but requires longer computational time to converge, especially when the sample size is large.

References

An, Weihua. 2010. "Bayesian Propensity Score Estimators: Incorporating Uncertainties In Propensity Scores Into Causal Inference." Sociological Methodology 40: 151-189. http://mypage.iu.edu/~weihuaan/Documents/2010_BPSE.pdf. Abadie, Alberto and Guido W. Imbens. 2011. ``Matching On the Estimated Propensity Score." Working Paper. http://mypage.iu.edu/~weihuaan/Documents/pscore_2011.pdf.

See Also

bpsr, modelpsm, modelpsr, Match, sortps

Examples

Run this code
library(boot)

a = 2; b = c(1, -2, 5); N = 500
x1 <- runif(N, 0, 1)
x2 <- runif(N, 0, 1)
X <- as.matrix(cbind(rep(1, N), x1, x2))
p <- inv.logit( X %*% b )
t <- rbinom(N, 1, p)
e <- rnorm(N, 0, 1)
Y <- 5 * t + a * ( x1 + x2 ) + e
bpsm( Y, t, X, method = "AI", estimand = "ATE" )

Run the code above in your browser using DataLab