FixedEffectModels.jl icon indicating copy to clipboard operation
FixedEffectModels.jl copied to clipboard

Lag/Lead Operators in @formula

Open junder873 opened this issue 3 years ago • 1 comments
trafficstars

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.

junder873 avatar Mar 01 '22 18:03 junder873

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.

matthieugomez avatar Mar 11 '22 15:03 matthieugomez

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.

eloualiche avatar Dec 02 '22 19:12 eloualiche