-
Notifications
You must be signed in to change notification settings - Fork 43
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
Comments
My guess is that you are calling the did package honest_did function, which
I think Brant and Pedro removed. You can still use the function here
<https://github.com/asheshrambachan/HonestDiD#staggered-timing>
…On Fri, Aug 25, 2023 at 5:03 AM martinhulenyi ***@***.***> wrote:
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))
`
—
Reply to this email directly, view it on GitHub
<#41>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6EXFC3KOFHD7AGBBLMPBTXXBS7RANCNFSM6AAAAAA36GSQNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks that was it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"
The text was updated successfully, but these errors were encountered: