作为硕士论文研究的一部分,我已经在 R 中实现了 MatchIt 包。该准则目前将一些可持续投资公司与非可持续投资公司的比例为 1:2。
我需要修改我的代码,以便匹配项具有匹配 ID。目前代码运行良好且匹配正确,但我不知道哪些公司与哪些控件配对。
任何人都可以提出修改建议吗?
我没有包含我的所有代码,因为我认为这太过分了,但匹配步骤的主要内容如下:
matchData <-
rbind(treat_firms_1year_prior,
control_firms_year_int_tx)
matchData <- matchData %>%
modify_at(c("country", "region", "strategy", "signatory", "eligible_treat_firm"), as.factor) %>%
arrange(investor, dealyear)
matchpanel3 <- MatchIt::matchit(eligible_treat_firm ~ counttotal + dealyear, exact= ~ region + strategy, data = matchData, distance = "mahalanobis", ratio = k+1)
任何建议都会非常受欢迎!
罗里