Learn R Programming

arm (version 1.0-1)

balanceplot: Plot of Balance Statistics

Description

This function plots the balance statistics before and after matching.

Usage

balanceplot(matched, pscore.fit, 
    longcovnames = NULL, 
    main = "Standardized Difference in Means", 
    cex.main = 1, cex.vars = 0.8, cex.pts = 0.8, 
    mar = c(0, 5, 4, 2), mgp = c(2, 0.25, 0), 
    oma = c(0, 0, 0, 0), tcl = -0.2, ...)

Arguments

matched
matched data using matching function, see the example below.
pscore.fit
glm.fit object to get propensity scores.
longcovnames
long covariate names. If not provided, plot will use covariate variable name by default
main
title of the plot
cex.main
font size of main title
cex.vars
font size of variabel names
cex.pts
point size of the estimates
mar
margin of the plot, see ?par for details
mgp
axis margin of the plot, see ?par for details
oma
outer margin of the plot, see ?par for details
tcl
length of ticks, see ?par for details
...
other plot options may be passed to this function

Details

This function plots the balance statistics before and after matching. The open circle dots represent the unmatched balance statistics. The solid dots represent the matched balance statistics. The closer the value of the estimates to the zero, the better the treated and control groups are balanced after matching.

References

Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2006. (Chater 10)

See Also

matching, par

Examples

Run this code
data(lalonde)
attach(lalonde)
fit <- glm(treat ~ re74 + re75 + age + factor(educ) + 
            black + hisp + married + nodegr + u74 + u75, 
            family=binomial(link="logit"))
pscores <- predict(fit, type="link")
matches <- matching(z=lalonde$treat, score=pscores)
matched <- lalonde[matches$matched,]  
balanceplot(matched, fit)

Run the code above in your browser using DataLab