Displaying 1 result from an estimated 1 matches for "linearmodel1".
Did you mean:
linearmodel
2009 Jul 15
2
storing lm() results and other objects in a list
to clean up some code I would like to make a list of arbitrary length
to store?various objects for use in a loop
sample code:
############ BEGIN SAMPLE ##############
# You can see the need for a loop already
linearModel1=lm(modelSource ~ .,mcReg)
linearModel2=step(linearModel1)
linearModel3=lm(modelSource ~ .-1,mcReg)
linearModel4=step(linearModel3)
#custom
linearModel5=lm(modelSource ~ . -ACF-MonthlyST1-MonthlyST2-MonthlyBLA,mcReg)
LinearModel1.res <- residuals(linearModel1)
LinearModel2.res <- residuals(li...