How to get a GLM where formula is programmatically generated

@nilshg just added support for creating a Term from a string (available in v0.6.14, which should automerge soon), so you can now do something like

terms = term.(names(data))
f = terms[1] ~ sum(terms[2:end]) # assuming first column is "y"
ols2 = lm(f, data)
3 Likes