Skip to main content

Your predict.lmpredict.lm code is calculating confidence intervalintervals for the fitted valuevalues. Your hand calculation is calculating prediction intervalintervals for new data. If Youyou want to haveget the same result from predict.lmpredict.lm that Youyou got from the hand calculation then change interval="confidence" interval="confidence" to interval="prediction" interval="prediction"

Your predict.lm code is calculating confidence interval for fitted value. Your hand calculation is calculating prediction interval for new data. If You want to have same result from predict.lm that You got from hand calculation change interval="confidence" to interval="prediction"

Your predict.lm code is calculating confidence intervals for the fitted values. Your hand calculation is calculating prediction intervals for new data. If you want to get the same result from predict.lm that you got from the hand calculation then change interval="confidence" to interval="prediction"

Source Link
MMJ
  • 206
  • 2
  • 3

Your predict.lm code is calculating confidence interval for fitted value. Your hand calculation is calculating prediction interval for new data. If You want to have same result from predict.lm that You got from hand calculation change interval="confidence" to interval="prediction"