anova2_2page

# anova2_2page - ANOVA II March 7 2007 Prediction of new...

This preview shows pages 1–4. Sign up to view the full content.

ANOVA II March 7, 2007 Prediction of new outcomes I Predictions can be made with any linear model, either regression or ANOVA I Let’s illustrate with the electricity usage data I t = a value of temperature I usage ( t ) = β 0 + β 1 t + β 2 t 2 = electricity usage in some future month with average temperature t I the predicted value of usage ( t ) is ± usage ( t ) = b β 0 + b β 1 t + b β 2 t 2

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

View Full Document
Conﬁdence and prediction intervals for new outcomes From previous page: ± usage ( t ) = b β 0 + b β 1 t + b β 2 t 2 I ± usage ( t ) estimates both I usage ( t ) = β 0 + β 1 t + β 2 t 2 + ± and I E { usage ( t ) } = β 0 + β 1 t + β 2 t 2 I prediction intervals for β 0 + β 1 t + β 2 t 2 + ± are wider than conﬁdence intervals for β 0 + β 1 t + β 2 t 2 I because of extra uncertainty due to ± Sinusoidal model For forecasting: I a better model has only month of the year as a predictor
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",

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/09/2009 for the course ORIE 312 taught by Professor D.ruppert,p.jacks during the Spring '08 term at Cornell.

### Page1 / 10

anova2_2page - ANOVA II March 7 2007 Prediction of new...

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

View Full Document
Ask a homework question - tutors are online