FixedEffects / FixedEffectModels.jl

Fast Estimation of Linear Models with IV and High Dimensional Categorical Variables
Other
227 stars 46 forks source link

Lag/Lead Operators in @formula #193

Closed junder873 closed 1 year ago

junder873 commented 2 years ago

Maybe this is an issue with StatsModels.jl, but I was wondering if there is a plan to allow lag and lead operators in formula (similar to R fixest). Originally I was going to post this in StatsModels.jl, since it doesn't seem like any Julia regression package implements lag/lead right now, but I saw this pull request that seemed to suggest it was in this package.

matthieugomez commented 2 years ago

I want to wait until Julia has a better lag function https://github.com/JuliaArrays/ShiftedArrays.jl/pull/37 For now, simply create the variable before generating the formula.

eloualiche commented 1 year ago

Closing this as lead/lag should be implemented in a separate package. This outside of the scope of fixedeffectmodels.

We have posted on shiftedarrays for this feature; hopefully we will find a way to implement it in the future.