insongkim / PanelMatch

111 stars 34 forks source link

Estimating ART w/ a moderator #92

Closed DamianBoldt closed 2 years ago

DamianBoldt commented 2 years ago

I am attempting to estimate qoi = "art" while also including a moderator.

Every time I attempt estimate the ART while including a moderating variable I receive the following error message:

Error in `[.data.frame`(data, , unit.id) : object 'unit.id' not found

I do not run into this error when estimating the ATT with the exact same moderator. Is it not possible to estimate the ART while including moderators?

adamrauh commented 2 years ago

Hi @DamianBoldt , would you mind sharing which version of the package you are using? This is quite likely just a bug, as this should be possible.

DamianBoldt commented 2 years ago

Hi @adamrauh, I currently have PanelMatch version 2.0.0 installed. I am using: R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043)

adamrauh commented 2 years ago

Ok, thanks @DamianBoldt ! Sorry about this. Let me see if I can replicate this with a toy example. If not, I may need some additional material from you so I can patch it.

adamrauh commented 2 years ago

@DamianBoldt I pushed a patch to the se_comparison branch. Would you mind trying to install that and giving it another go? Thanks!

DamianBoldt commented 2 years ago

@adamrauh This is my first time trying to install something from a branch other than the master. I want to make sure I do it correctly so that I can tell you whether the patch works for me or not. Would you mind giving me some guidance on how to make sure I install the patch from the se_comparison branch correctly?

adamrauh commented 2 years ago

@DamianBoldt No problem, sorry for the delay. Try this:

remove.packages("PanelMatch")
library(devtools)
install_github("insongkim/PanelMatch", ref = "se_comparison", dependencies=TRUE)
DamianBoldt commented 2 years ago

Hi @adamrauh, thank you for helping me download from the se_comparison branch. That change to the helper files fixed my issue; I now have no problems estimating the ART while including a moderator variable. Thanks for your assistance!

adamrauh commented 2 years ago

Great to hear @DamianBoldt ! We will work on putting out a new CRAN version soon. I'll close the ticket, but let me know if you have other questions/issues.