# NOT RUN {
#
# Simple illustration
#
x = rnorm(10)
y = rep(1:4, 3)[1:10]
cbind(x, y, i(x, y, 1))
#
# In fixest estimations
#
# NOTA: in fixest estimations, i(var, fe, ref) is equivalent to var::fe(ref)
data(base_did)
# We interact the variable 'period' with the variable 'treat'
est_did = feols(y ~ x1 + i(treat, period, 5) | id+period, base_did)
# You could have used the following formula instead:
# y ~ x1 + treat::period(5) | id+period
# }
Run the code above in your browser using DataLab