Learn R Programming

MatchItEXT (version 0.0.1)

plot_smd: Draw a dot-line plot that compares the SMD change before and after matching

Description

This function accepts the data set from compute_smd() and draws a dot-line plot to compare the SMD change before and after matching. This function differs from plot(summary(data, standardize = T) in MatchIt package in the following aspects: (1) it uses the original SMD values, rather than the absolute SMD values; (2) overall SMD line is colored in blue; (3) increased SMD line is colored in brick red; (4) decreased SMD line is colored in gray. This function depends on ggplot2. If users are not satisfied with the plot, it can be revised with ggplot2. Relevant data and codes are stored in the returned list.

Usage

plot_smd(smd_data = NULL)

Arguments

smd_data

a data frame derived from compute_smd

Value

Return a list of relevant data, code, and plot

See Also

plot_ps_qq()

Examples

Run this code
# NOT RUN {
m_out <- MatchIt::matchit(treat ~ re74 + re75 + age + educ + hispan +
 black, data = MatchIt::lalonde, method = "nearest")
opt_smd <- compute_smd(m_out, sd = "treatment")
plot_smd_data <- plot_smd(opt_smd)
# }

Run the code above in your browser using DataLab