Skip to content
Prev 30090 / 398503 Next

lm with an arbitrary number of terms

The following might work:

	mdl <- paste("y~", paste(names(data.frame), collapse="+"))
	lm(mdl, ...)

If y = "y" is a column of your data.frame, you can delete it be 
selecting "names(data.frame)[!is.element(y, names(data.frame)]"

Can you solve the problem from here?
Best Wishes,
Spencer Graves
Richard Nixon wrote: