I fitted a weighted regression model to predict age as a function of several DNA methylation markers (expressed in percentages). I used weighted regression because the variance of my original OLS model increases with age.
When using the predict function to generate prediction intervals for a set of new samples,
predict(fGLS, newdata = Testset, interval = "prediction", level = 0.95)
I get the following warning:
Warning message:
In predict.lm(fGLS, newdata = Testset, interval = "prediction", :
Assuming constant prediction variance even though model fit is weighted
I tried adding the same weights I used to fit the model and this no longer yielded a warning;
predict(fGLS, newdata = Testset, interval = "prediction", level = 0.95,
weights = 1/hhat)
I have two questions:
Am I correct in simply adding the same weights I used to fit the weighted regression model, to the predict function? What does this effectively do?
In the first situation, my prediction intervals are roughly the same size throughout the data in my test set. In the second situation, the prediction intervals become larger with increasing age. Does this mean my prediction intervals in the first situation are wrong? Or is it okay to have equal interval sizes since I "corrected" for heteroskedasticity by using weighted regression? In other words, can I afford to simply ignore the warning?