0
votes

I am using the MatchIt package to find the nearest neighbor. The problem I am having is that I want R to match within the pool of brown bonds only (when dummy=1), that are from the same country and industry as the treaded firms and in the same year. In other words, partly exact match and some Mahalonbis to what I can understand, and my problem is i dont know how to combine them both in a matchit function when distance=mahalanobis already.

Sample data:

    Brown <- c("1","1","0","1","0","1","0","0")
    SIC <- c(10, 11, 67, 20, 31, 12, 31, 31)
    year <- c("2013","2013","2012","2014","2013","2012","2011","2013")
    size <- c(2000,1000,1200,3100,3131,1233,1920,910)
    tobinsq <- c(13,23,11,1,31,131,321,111)
    country <- c("US","CA","NO","US","US","ES","CA","US")

    dframe <- data.frame(Brown,year,SIC,country,tobinsq)

# Mahalanobis distance matching - no PS estimated

    matchman <- matchit(treat ~ size + tobinsq, data = dframe,
    distance = "mahalanobis")

How do incorporate Brown, year, SIC country here (they need to match exactly with the treated)?

Hope someone can help me!

1

1 Answers

0
votes

Use the exact argument. Your code would look like the following:

matchman <- matchit(treat ~ size + tobinsq, data = frame,
                    distance = "mahalanobis",
                    exact = ~Brown + year + SIC + country)

See help("matchit"), help("method_nearest"), or vignette("estimating-effects", package = "MatchIt") for more information. This is a well-documented feature.