anova2_article

anova2_article - 1 Prediction Prediction of new outcomes...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Prediction Prediction of new outcomes Predictions can be made with any linear model, either regres- sion or ANOVA Let’s illustrate with the electricity usage data t = a value of temperature usage ( t ) = β 0 + β 1 t + β 2 t 2 = electricity usage in some future month with average temperature t the predicted value of usage ( t ) is ± usage ( t ) = b β 0 + b β 1 t + b β 2 t 2 Confidence and prediction intervals for new outcomes From previous page: ± usage ( t ) = b β 0 + b β 1 t + b β 2 t 2 ± usage ( t ) estimates both usage ( t ) = β 0 + β 1 t + β 2 t 2 + ± and E { usage ( t ) } = β 0 + β 1 t + β 2 t 2 prediction intervals for β 0 + β 1 t + β 2 t 2 + ± are wider than con- fidence intervals for β 0 + β 1 t + β 2 t 2 because of extra uncertainty due to ± Sinusoidal model For forecasting: a better model has only month of the year as a predictor
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
R code – using sinusoidal model eldata <- read.table(’elec_usage.txt’,header=TRUE) eldata.lm <- lm(usage~sin(pi*month/6)+cos(pi*month/6),data=eldata) new = data.frame(month = seq(1,12,1)) pred.plim <- predict.lm(eldata.lm, new, interval="prediction") pred.clim <- predict.lm(eldata.lm, new, interval="confidence") pdf(’electricity_sine_prediction.pdf’) matplot(new$month,cbind(pred.clim, pred.plim[,-1]), lty=c(1,2,2,3,3),lwd=c(2,2,2,3,3), col=c("black","red","red","blue","blue"), type="b",pch="*",cex=3, ylab="predicted electricity usage",
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

anova2_article - 1 Prediction Prediction of new outcomes...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online