I have code below using the build-in dataset mtcars:
data(mtcars)
model_1 <- lm(mpg ~ wt + log(wt), data = mtcars)
summary(model_1)
model_2 <- lm(mpg ~ wt + wt^2, data = mtcars)
summary(model_2)
In model_1, things work well and I have two features wt and log(wt) in my regression result.
But in model_2, I only have wt in the result, and I don't have the square of wt. Why and how to fix?