5
Suppose the following data.frame
:
set.seed(1)
dados <- data.frame(y=rnorm(100), x1=rnorm(100), x2=rnorm(100), x3=rnorm(100), x4=rnorm(100))
If I want to run a y regression against x1
...xn
, I can do it this way:
modelo <- lm(y~x1+x2+x3+x4, data=dados)
In this case since it only has 4 variables, it is not exhaustive to describe all. But assuming that they were 100 variables, that is, of x1
until x100
. How to select all in an easy way for regression?