When using a global variable to set the bin or related sunab(bin.rel = ) argument, I get an error that seems not quite appropriate?
BINS <- c(-1:-4)
res_twfe = feols(y ~ x1 + i(time_to_treatment, ref = c(-1, -1000), bin = BINS) | id + year, base_stagg)
# works
summary(res_twfe)
BINS <- c(-1:-5)
res_twfe = feols(y ~ x1 + i(time_to_treatment, ref = c(-1, -1000), bin = BINS) | id + year, base_stagg)
# Error in feols(y ~ x1 + i(time_to_treatment, ref = BINS) | id + year, :
# The variable 'BINS' is in the RHS (first part) of the formula but not in the data set.
res_twfe = feols(y ~ x1 + i(time_to_treatment, ref = c(-1, -1000), bin = c(-1:-5)) | id + year, base_stagg)
# works again
summary(res_twfe)
This is based on the example from the docs.
When using a global variable to set the
bin
or relatedsunab(bin.rel = )
argument, I get an error that seems not quite appropriate?