Displaying 1 result from an estimated 1 matches for "coparison".
Did you mean:
comparison
2005 Nov 18
3
Fitting model with varying number of predictors
I need to fit a number of models with different number of predictors
in each model. Say for example, I have three predictors: x1, x2, x3
and I want to fit three models:
lm(y~x1+x2)
lm(y~x2+x3)
lm(y~x1+x2+x3)
Instead of typing all models, what I want is to create a variable
which can take the right hand side of the models. I tried this with
paste function.