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

Feature request: support . notation in formula

Open murphyk opened this issue 6 years ago • 2 comments
trafficstars

It would be very useful to write "Y ~ . " to mean "regress on all inputs". Here is a proposed solution: https://stackoverflow.com/questions/44222763/specify-only-target-variable-in-glm-jl But it does not work in StatsModels v0.5 and Julia 1.1.

murphyk avatar Feb 06 '19 00:02 murphyk

More generally it would be nice to have a way to regress on all variable satisfying certain conditions (a regex, or dplyr-like conditions like starts_with, contains etc).

matthieugomez avatar Mar 20 '19 14:03 matthieugomez

@murphyk the SO solution would work if combined with the "constructing formula programatically" section from the docs: https://juliastats.github.io/StatsModels.jl/latest/formula/#Constructing-a-formula-programatically-1 (update: should work on master)

@matthieugomez I think those could be implemented as "special terms", with a few tweaks (currently calls to empty functions error, the schema extraction code would need some changes, etc.)

kleinschmidt avatar Mar 26 '19 14:03 kleinschmidt