# Using all variables on a regression?

**URL:** https://discourse.julialang.org/t/using-all-variables-on-a-regression/17766
**Category:** General Usage
**Created:** [November 20, 2018, 12:46pm UTC](https://discourse.julialang.org/t/using-all-variables-on-a-regression/17766 "2018-11-20T12:46:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)
#### Post date: [November 20, 2018, 12:46pm UTC](https://discourse.julialang.org/t/using-all-variables-on-a-regression/17766/1 "2018-11-20T12:46:18Z")

</div>

Is there any way to quickly say Julia I want to use all variables on a regression’s formula without explicitly writing them by hand?  
(Something like R’s “.” to select all columns for the model)  
It’s useful when you have many variables.  
How can you do it if you also want to add interactions?

lm(@formula(y ~ .), data)
