Edit2: Ok, is working now but I need to use your solution in the in the lm() directly, instead of being able to create a @formula variable. would be nice to be able to do a @formula variable, specially for cross validation and other that need to work with that. But for the time being, thank you again.
Thanks, it was give me an error:
LoadError: ArgumentError: non-call expression encountered: Term.(Symbol.(names(df[:, Not(:Y])))
but I solve it creating a variable with the sum of the independent variables like this
IndependVars = sum(Term.(Symbol.(names(df[:, Not(:Y)]))))
and using it as
fm = @formula(Y ~ IndependVars)
edit: my solution is not working, the lm thinks that IndependVars is a column in my df…