-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi @kleinschmidt,
I think the Julia ecosystem would benefit from something like this!
If we wanna do serious stats it should be easy to automatically generate all interactions (up order n) etc.
Some things I find particularly useful in my other stats packages outside Julia:
-
"i.x1" makes x1 into a factor variable in a formula
Suppose x1 takes the values: 1.2, 5, 6.4
reg y x1: treats x1 as continuous & returns 1 coef (assuming no intercept)
reg y i.x1creates 3 dummies for each level of x1 & returns 3 coefficients
(if there is an intercept it randomly drops one level unless the user chooses which level to drop) -
i.x1#(c.x2 i.x3)
Interacts all dummies of x1 w/ x2 (continuous)
Interacts all dummies of x1 w/ all dummies of x3 -
Leads & Lags. Suppose D is at the state-year level.
L.D: creates a 1 year lag of D
L(4).D: creates a 4 year lag of D
F(4).D: creates a 4 year lead of D.$D_{t+4}$
reg y F(-1 0 1 2).D
estimates: y_t =b_{-1} x_{t-1} + b_{0} x_{t} +b_{1} x_{t+1} +b_{2} x_{t+2}
If Julia is to be "as easy for statistics as R" these features should be in StatsModels.
I'd love to help if I can.