Displaying 1 result from an estimated 1 matches for "apaarch".
Did you mean:
aparch
2010 Oct 03
5
How to iterate through different arguments?
If I have a model line = lm(y~x1) and I want to use a for loop to change the
number of explanatory variables, how would I do this?
So for example I want to store the model objects in a list.
model1 = lm(y~x1)
model2 = lm(y~x1+x2)
model3 = lm(y~x1+x2+x3)
model4 = lm(y~x1+x2+x3+x4)
model5 = lm(y~x1+x2+x3+x4+x5)...
model10.
model_function = function(x){
for(i in 1:x) {
}
If x =1, then the list