library("unitdid")
library(unitdid)
<- base_heterocp |>
mdl_base unitdid(yname = "y",
iname = "id",
tname = "year",
ename = "cyear",
bname = "byear")
summary(mdl_base, agg = "event_age")
# A tibble: 144 × 4
mean rel_time n event_age
<dbl> <int> <dbl> <int>
1 -0.0344 0 13 15
2 -0.0860 0 42 16
3 -0.170 0 59 17
4 -0.141 0 79 18
5 -0.0883 0 99 19
6 -0.0689 0 107 20
7 -0.115 0 158 21
8 -0.0684 0 165 22
9 -0.0778 0 168 23
10 -0.0567 0 206 24
# ℹ 134 more rows