Description Usage Arguments Details Value Author(s) References See Also Examples
svmmatch
estimates balancing weights in the presence of non-random treatment assignment. The method allows the researcher to assess the two crucial ignorability assumptions: a test of sensitivity to omitted confounders and a test of common support between treated and control. A fully Bayesian implementation allows characterization of the posterior of the treatment effect. The method is implemented in C++ through Rcpp, greatly speeding calculation time.
1 |
treat |
A binary vector indicating treatment status. |
X |
A covariate matrix. |
burnin |
Number of burnin draws for the Gibbs sampler. |
gibbs |
Number of posterior draws to be saved. |
thin |
Number of chains when thinning. If burnin = 10, gibbs = 20, and thin=30,then 500 = 10 x 30 + 20 x 30 samples will be drawn, but only 20 returned. |
dv |
A dependent variable of interest. Optional. |
Fits SVMMatch to the data, returning balancing weights and a posterior density of the estimated effect.
effect |
Posterior density of treatment effect on dv. |
beta |
Matrix of posterior draws for coefficients. |
margin |
Binary vector for posterior estimate of marginal observations. |
bal.wts |
Balancing weights. |
X.scale |
Scaled covariate matrix. Used internally. |
X.orig |
Original matrix of covariates. |
treat |
Treatment vector. |
dv |
The dependent variable. |
Marc Ratkovic
Ratkovic, Marc. 2014. "Balancing within the Margin: Causal Effect Estimation with Support Vector Machines." Working paper.
balance, effect, sensitivity, control.overlap, treatment.overlap, LaLonde
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ##Load data
data("LaLonde")
Data1<-LaLonde
Data1<-Data1[Data1$exper==0|Data1$treat==1,]
attach(Data1)
##Format X matrix
varnames<-c("age","educ","black","married","nodegr","hisp",
"re75","re74")
X<-cbind(Data1[,varnames],Data1$re75==0,Data1$re74==0)
X<-as.matrix(X)
##Fit model
set.seed(1)
m1.param<-svmmatch(treat, X, dv=re78, burnin=100, gibbs=100, thin=5)
##Assess balance
bal1<-balance(treat, X, m1.param)
##Summarize treatment effect
effect1<-effect(m1.param)
## Not run:
##Sensitivity analysis (Takes a little longer)
sens1<-sensitivity(m1.param)
## End(Not run)
##Assess ignorability:
#Assess control overlap--are there enough
#controls to balance the treated?
cont1<-control.overlap(m1.param)
#Assess treatment overlap--are there treated
#values that can't be matched?
treat1<-treatment.overlap(m1.param)
##Assess autocorrelation
ac1<-autocorr(m1.param)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.