Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honest_did function not working #41

Closed
martinhulenyi opened this issue Aug 25, 2023 · 2 comments
Closed

Honest_did function not working #41

martinhulenyi opened this issue Aug 25, 2023 · 2 comments

Comments

@martinhulenyi
Copy link

martinhulenyi commented Aug 25, 2023

Hello,
I am trying to implement the honest_did paralell trends test to my results, but I get an error that the honest_did no longer works. Is the comment discontinued?

`nightl1 <- nightl %>%
filter(year >1992, d50_EXT == 0 & d50_ENLDD == 0 & d50_ENLN3 == 0 & d50_EFTA == 0 & d50_EXTHR ==0,
d100_ENLE8 == 1 | d100_ENLE2 == 1 & ENLE8 > 50 | d100_ENLHR ==1 & ENLE8 > 50,
d2530_ENLE8 == 0 & d3035_ENLE8 == 0 & d3540_ENLE8 == 0 & d4045_ENLE8 == 0 & d4550_ENLE8 == 0,
d2530_ENLE2 == 0 & d3035_ENLE2 == 0 & d3540_ENLE2 == 0 & d4045_ENLE2 == 0 & d4550_ENLE2 == 0,
d2530_ENLHR == 0 & d3035_ENLHR == 0 & d3540_ENLHR == 0 & d4045_ENLHR == 0 & d4550_ENLHR == 0,
CNTR_CODE %in% c("EE", "LV", "LT", "PL", "CZ", "SK", "HU", "SI", "BG", "HR", "RO", "AT", "DE", "DD", "IT", "EL")) %>%
mutate(treatment = ifelse(d25_ENLE8 == 1 & nearest_group == "ENLE8", 2004,
ifelse(d25_ENLE2 == 1 & nearest_group == "ENLE2" , 2007,
ifelse(d25_ENLHR == 1 & nearest_group == "ENLHR" , 2013, 0))))
a <- nightl1 %>%
group_by(treatment) %>%
tally()
knitr::kable(a)

nightl1 %<>%
group_by(id) %>%
mutate(id = cur_group_id()) %>%
ungroup()

nightl1 <- as.data.frame(nightl1)

res<- att_gt(yname = "Delta_NL", tname = "year", idname = "id", gname = "treatment", data = nightl1, control_group = "notyettreated", base_period = "universal", clustervars = "nuts3")

es <- did::aggte(res, type = "dynamic",
min_e = -5, max_e = 5)

sensitivity_results <-
honest_did(es,
e=0,
type="relative_magnitude",
Mbarvec=seq(from = 0.5, to = 2, by = 0.5))

`

Error in honest_did(es, e = 0, type = "relative_magnitude", Mbarvec = seq(from = 0.5, :
could not find function "honest_did"

@jonathandroth
Copy link
Collaborator

jonathandroth commented Aug 25, 2023 via email

@martinhulenyi
Copy link
Author

Thanks that was it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants