Learn R Programming

Matching (version 1.7)

ks.boot: Bootstrap Kolmogorov-Smirnov

Description

This function executes a bootstrap version of the univariate Kolmogorov-Smirnov test which provides correct coverage even when the distributions being compared are not entirely continuous. Ties are allowed with this test unlike the traditional Kolmogorov-Smirnov test.

Usage

ks.boot(Tr, Co, nboots=1000, verbose=0)

Arguments

Tr
A vector containing the treatment observations.
Co
A vector containing the control observations.
nboots
The number of bootstraps to be performed. These are, in fact, really Monte Carlo simulations which are preformed in order to determine the proper p-value from the empiric.
verbose
If this is greater than 1, then the simulation count is printed out while the simulations are being done.

Value

  • ksboot.pvalueThe bootstrap p-value of the Kolmogorov-Smirnov test for the hypothesis that the probability densities for both the treated and control groups are the same.
  • ksReturn object from ks.test.
  • nbootsThe number of bootstraps which were completed.

References

Sekhon, Jasjeet S. 2004. ``Balance Tests for Matching Estimators.'' Working Paper.

Diamond, Alexis and Jasjeet S. Sekhon. 2005. ``Genetic Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' Working Paper. http://sekhon.polisci.berkeley.edu/papers/GenMatch.pdf

Abadie, Alberto. 2002. ``Bootstrap Tests for Distributional Treatment Effects in Instrumental Variable Models.'' Journal of the American Statistical Association, 97:457 (March) 284-292.

See Also

Also see summary.ks.boot, balanceUV, Match, GenMatch, MatchBalance, balanceMV, GerberGreenImai, lalonde

Examples

Run this code
#
# Replication of Dehejia and Wahba psid3 model
#
# Dehejia, Rajeev and Sadek Wahba. 1999.``Causal Effects in Non-Experimental Studies: Re-Evaluating the
# Evaluation of Training Programs.''Journal of the American Statistical Association 94 (448): 1053-1062.
#
data(lalonde)

#
# Estimate the propensity model
#
glm1  <- glm(treat~age + I(age^2) + educ + I(educ^2) + black +
             hisp + married + nodegr + re74  + I(re74^2) + re75 + I(re75^2) +
             u74 + u75, family=binomial, data=lalonde)


#
#save data objects
#
X  <- glm1$fitted
Y  <- lalonde$re78
Tr  <- lalonde$treat

#
# one-to-one matching with replacement (the "M=1" option).
# Estimating the treatment effect on the treated (the "estimand" option which defaults to 0).
#
rr  <- Match(Y=Y,Tr=Tr,X=X,M=1);
summary(rr)

#
# Do we have balance on 1975 income after matching?
#
ks  <- ks.boot(lalonde$re75[rr$index.treated], lalonde$re75[rr$index.control], nboots=500)
summary(ks)

Run the code above in your browser using DataLab