# How to define a formula with a vector of string names for GLM.jl?

**URL:** https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930
**Category:** General Usage
**Created:** [August 14, 2020, 12:44pm UTC](https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930 "2020-08-14T12:44:28Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [August 14, 2020, 1:20pm UTC](https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930/4 "2020-08-14T13:20:11Z")

</div>

See my answer here: [Using all independent variables with @formula in a multiple linear model - #2 by nilshg](https://discourse.julialang.org/t/using-all-independent-variables-with-formula-in-a-multiple-linear-model/43691/2)

Basically what the preceding posts say - you want to construct `Term` objects from symbols, in the other thread I’m doing this for all columns `names(df)` but that of course easily generalizes to a vector holding whatever subset of columns you’re interested in.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930)._
