I want to run regression y = b0 + b1x + b2x^2 + u, but I'm not sure how to do this. I've tried lm(y~x), but I don't get an estimate for the coefficient of x^2.
How can I run this regression so that when I summarize the results R gives me an estimate for bot b1 and b2?
coef(lm(y ~ poly(x, 2, raw = TRUE)))
https://stackoverflow.com/questions/3822535/fitting-polynomial-model-to-data-in-r