I'm running a dif-in-dif estimation and using the MatchIt package to match my treatment and control groups by their distance to a certain location (nearest neighbour matching, logit model, caliper = 0.25).
Everything is ok with the actual matching, however I ran across this kind of plot in a paper I read:
I'm a bit confused, how is it possible to plot propensity scores before matching since the matching itself gives the propensity scores? So if anyone is familiar with this kind of plotting I'd appreciate help. Here's my code so far, which only gives the density functions after matching for treatment (Near) and control.
m.df <- matchit(Near ~ Distance_to_center, data = df, method = "nearest", distance = "logit", caliper =0.25)
mdf <- match.data(m.df,distance = "pscore")
df <- mdf
plot(density(df$pscore[df$Near==1]))
plot(density(df$pscore[df$Near==0]))