for constructing the data frame you can
-
push!aNamedTuplein a loop, so you work with named tuples insteadVectors ininput. - Make a
Matrixviamapreduce(permutedims, vcat, input)and construct a DataFrame from that matrix viaDataFrame(mat, :auto).
For using lm you can
- Use
lm(y, X)instead of@formula - Construct a formula programmatically in the method described here.