out <- glm(y ~ . , family=binomial(),data=turnout)
In R, above syntax works and i expected that’s similar to julia, but .
is not a proper symbol in GLM.jl
maybe.
julia> out = glm(@formula(y ~ .), train, Binomial())
ERROR: syntax: invalid identifier name "."
Thanks, but your solution is written at 2 years ago and i’ll very happy if there exists a better way. Is that still the best?
Yes, still the best way.
Well, the way it’s written is awkward.
julia> term(:y) ~ sum(term.(names(df, Not(:y))))
FormulaTerm
Response:
y(unknown)
Predictors:
x1(unknown)
x2(unknown)
1 Like
nilshg
5
Ha, I guess something did change in the intervening period and I should have known
2 Likes