Learn R Programming

SVMMatch (version 1.1)

sensitivity: Sensitivity analysis for SVMMatch.

Description

sensitivity assesses the sensitivity of an effect estimate to an omitted confounder.

Usage

sensitivity(obj, seq.eval=seq(-1,1,.1), quant.eval=c(0.025,0.5,0.975), color=TRUE, legend.pos="topleft", label.main="Sensitivity Analysis", label.x="Sensitivity Parameter", label.y="Outcome")

Arguments

obj
A fitted SVMMatch object.
seq.eval
Values at which to set the omitted confounder, in the range [-1, +1].
quant.eval
Values at which to plot the posterior density as a function of the omitted confounder. By default, a solid line is drawn through the posterior medians, with dashed lines at the 2.5th and 97.5th percentiles.
color
Whether to plot in color or black and white. TRUE or FALSE.
legend.pos
Where to place the margin. See the help file for legend.
label.main
Main title for figure
label.x
X-axis label.
label.y
Y-axis label.

Value

sens.mat
A matrix of the posterior estimates as a function of the unobserved confounder.

Details

Conducts a sensitivity analysis using an SVMMatch object. An unoberseved parameter, u, that predicts the treatment assignment is introduced and varied between -1 and 1. For each value of u, balancing weights are constructed and the posterior density of the effect estimate recalcluated, with u=0 returning the results from the original fit. The figure gives the researcher a sense as to how sensitive the effect estimate is to omitted confounders.

References

Ratkovic, Marc. 2014. "Balancing within the Margin: Causal Effect Estimation with Support Vector Machines." Working paper.

See Also

svmmatch, legend

Examples

Run this code
## Not run: 
# ##See svmmatch() for a full implementation
# ##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)
# 
# ##Sensitivity analysis (Takes a little longer)
# 	sens1<-sensitivity(m1.param)
# 
# 	## End(Not run)

Run the code above in your browser using DataLab