Hey all, I'm performing polynomial regression. I'm simulating x values using runif() and y values using a deterministic function of x and rnorm().
When I perform polynomial regression like this: fit_poly <- lm(y ~ poly(x,11,raw = TRUE)) I get some NA coefficients. I think this is due to the high correlation between say x and x^2 if x is distributed uniformly on the unit interval (as is the case in my example). However, I'm still able to plot a polynomial fit like this: points(x, predict(fit_poly), type="l", col="green", lwd=2) What I'm interested in finding out is, how R handles the NA values I get for some coefficients (and how that affects the polynomial I see plotted). Thanks! ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.