How can I fit a Polynomial Regression over all the dataframe's variables? It it were a linear regression, I would do:
lm.fit = lm(response~., data=dataset, subset=train)
but if I want a 2-nd (or higher) grade fit, I cannot use poly()
as follows:
lm.fit = lm(reads_avg~poly(., i), data=dataset, subset=train)
In particular, poly doesn't seem to accept the point (.
) as input.