bpsr: Bayesian Propensity Score Regression

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/bpsr.R

Description

A function uses Bayesian methods to incorporate uncertainties in estimated propensity scores and provide adjusted standard errors for propensity score regressions.

Usage

1
bpsr(Y, t, X, 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.

K

Numbers of iterations.

S

Number of posterior samples.

Details

Estimated propensity scores are used as an additional covariate in the main outcome model to control for selection or to provide better control for the nonlinear effects of covariates. The function bpsr takes into account the uncertainties in estimating the propensity scores and adjusts the standard errors accordingly.

Value

estimates

The estimated treatment effects and their adjusted standard errors. Phat shows the results with unadjusted standard errors. BPSR shows the results with adjusted standard errors using the Bayesian method.

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. The function bpsr uses the posterior standard deviation to approximate the standard error.

Note

To use bpsr, first install JAGS to the local computer. JAGS is available at http://mcmc-jags.sourceforge.net/.

Author(s)

Weihua An, Huizi Xu, and Zhida Zheng, Indiana University Bloomington.

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.

See Also

bpsm, modelpsm, modelpsr, Match, sortps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(boot)

a = 2; b = c(1, -2, 5); N = 500
x1 <- runif(N, 0, 1)
x2 <- runif(N, 0, 1)
X <- 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
bpsr(Y, t, X )

## End(Not run)

IUPS documentation built on May 29, 2017, 9:12 a.m.