- Electricity consumption was recorded for a small town on 12 randomly
chosen days. The following maximum temperatures (degrees Celsius)
and consumption (megawatt-hours) were recorded for each day.
- Plot the data and find the regression model for Mwh with
temperature as an explanatory variable. Why is there a negative
- Produce a residual plot. Is the model adequate? Are there any
outliers or influential observations?
- Use the model to predict the electricity consumption that you
would expect for a day with maximum temperature $10^\circ $
and a day with maximum temperature $35^\circ $. Do you
believe these predictions?
- Give prediction intervals for your forecasts.
The following R code will get you started:
plot(Mwh ~ temp, data=econsumption)
fit <- lm(Mwh ~ temp, data=econsumption)
plot(residuals(fit) ~ temp, data=econsumption)
- The following table gives the winning times (in seconds) for the
men’s 400 meters final in each Olympic Games from 1896 to 2012 (data
- Update the data set `olympic` to include the winning times from
the last few Olympics.
- Plot the winning time against the year. Describe the main
features of the scatterplot.
- Fit a regression line to the data. Obviously the winning times
have been decreasing, but at what *average* rate per year?
- Plot the residuals against the year. What does this indicate
about the suitability of the fitted line?
- Predict the winning time for the men’s 400 meters final in the
2000, 2004, 2008 and 2012 Olympics. Give a prediction interval
for each of your forecasts. What assumptions have you made in
- Find out the actual winning times for these Olympics (see www.databaseolympics.com).
How good were your forecasts and prediction intervals?
- An elasticity coefficient is the ratio of the percentage change in
the forecast variable ($y$) to the percentage change in the
predictor variable ($x$). Mathematically, the elasticity is
defined as $(dy/dx)\times (x/y)$. Consider the log-log model,
\log y=\beta _0+\beta _1 \log x + \varepsilon .
$y$ as a function of $x$ and show that the coefficient $\beta_1$ is the elasticity coefficient.