- 90 Views
- Uploaded on
- Presentation posted in: General

Lecture 20

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

- Simple linear regression (18.6, 18.9)
- Homework 5 is posted and is due next Tuesday at 3 p.m. (Note correction on question 4(e)).
- Regular office hours: Tuesday, 9-10, 12-1.
- Extra office hours: Today (after class), Monday, 10-11.
- Midterm 2: Wednesday, April 2nd, 6-8 p.m.

A point prediction

- Example 18.7
- Predict the selling price of a three-year-old Taurus with 40,000 miles on the odometer (Example 18.2).

- It is predicted that a 40,000 miles car would sell for $14,575.
- How close is this prediction to the real price?

- The prediction interval

- The confidence interval

- Two intervals can be used to discover how closely the predicted value will match the true value of y.
- Prediction interval – predicts y for a given value of x,
- Confidence interval – estimates the average y for a given x.

- Example 18.7 - continued
- Provide an interval estimate for the bidding price on a Ford Taurus with 40,000 miles on the odometer.
- Two types of predictions are required:
- A prediction for a specific car
- An estimate for the average price per car

- Solution
- A prediction interval provides the price estimate for a single car:

t.025,98

Approximately

- Solution – continued
- A confidence interval provides the estimate of the mean price per car for a Ford Taurus with 40,000 miles reading on the odometer.
- The confidence interval (95%) =

- A confidence interval provides the estimate of the mean price per car for a Ford Taurus with 40,000 miles reading on the odometer.

- As xg moves away from x the interval becomes longer. That is, the shortest interval is found at

- As xg moves away from the interval becomes longer. That is, the shortest interval is found at

- As xg moves away from the interval becomes longer. That is, the shortest interval is found at .

- Remember that predicting y based on x from a regression is only reliable if x falls inside the range of the data observed.
- Extrapolation is dangerous.

- The four conditions required for the validity of the simple linear regression analysis are:
- the mean of the error variable conditional on x is zero for each x
- the error variable is normally distributed.
- the error variance is constant for all values of x.
- the errors are independent of each other.

- How can we diagnose violations of these conditions?

- Examining the residuals helps detect violation of the required conditions
- A residual plot is a scatterplot of the regression residuals against another variable, usually the independent variable or time.
- If the simple linear regression model holds, there should be no pattern in the residual plots.
- Don’t read too much into these plots. You’re looking for gross departures from a random scatter.

- Utopia.jmp is a simulation from a simple linear regression model (all assumptions hold).

- If the residual plot has a curved pattern, this indicates that the regression function is not a straight line.
- Transformations to deal with the problem of a curved regression function rather than a straight line regression function later in the lecture.

^

y

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

^

The spread increases with y

- When the requirement of a constant variance is violated we have a condition of heteroscedasticity.
- Diagnose heteroscedasticity by plotting the residual against the predicted y.

Residual

+

+

+

+

+

+

+

+

+

+

+

+

+

^

+

+

+

y

+

+

+

+

+

+

+

+

- When the requirement of a constant variance is not violated we have a condition of homoscedasticity.
- Example 18.2 - continued

- A time series is constituted if data were collected over time.
- Examining the residuals over time, no pattern should be observed if the errors are independent.
- When a pattern is detected, the errors are said to be serially correlated (or autocorrelated)
- Serial correlation can be detected by graphing the residuals against time.

Non Independence of Error Variables

Patterns in the appearance of the residuals over time indicates that autocorrelation exists.

Residual

Residual

+

+

+

+

+

+

+

+

+

+

+

+

+

+

0

0

+

Time

Time

+

+

+

+

+

+

+

+

+

+

+

+

+

Note the runs of positive residuals,

replaced by runs of negative residuals.

Positive serial correlation.

Note the oscillating behavior of the

residuals around zero.

Negative serial correlation.

- To check the normality of the error variable, draw a histogram of the residuals.
- Violation of normality only has a serious effect on confidence intervals and tests if the sample size is small (less than 30) and there is either strong skewness or outliers.

- An outlier is an observation that is unusually small or large.
- Three types of outliers in scatterplots:
- Outlier in x direction
- Outlier in y direction
- Outlier in overall direction of scatterplot (residual has large magnitude)

- Several possibilities need to be investigated when an outlier is observed:
- There was an error in recording the value.
- The point does not belong in the sample.
- The observation is valid.

- Identify outliers from the scatterplot

- An observation has high leverage if it is an outlier in the x direction.
- An observation is influential if removing it would markedly change the least squares line.
- Observations that have high leverage are influential if they do not fall very close to the least squares line for the other points.

+

+

+

+

+

+

+

+

+

+

+

An influential observation

An outlier

+

+

… but, some outliers

may be very influential

+

+

+

+

+

+

+

+

+

+

+

+

+

+

The outlier causes a shift

in the regression line

- Suppose that the residual plot indicates curvature in the regression function. What do we do?
- One possibility: Transform x or transform y.
- Tukey’s Bulging Rule (see Handout).

- Y=Sales, X=Display Feet
- Y=Sales, X=Square Root of Display Feet/Log of Display Feet

- Linear Fit
- Sales = -46.28718 + 154.90188 Square Root DisplayFeet
- For 5 display feet, the average amount of sales is

- One of the most important applications of linear regression is the market model.
- It is assumed that rate of return on a stock (R) is linearly related to the rate of return on the overall market.
R = b0 + b1Rm +e

Rate of return on a particular stock

Rate of return on some major stock index

The beta coefficient measures how sensitive the stock’s rate

of return is to changes in the level of the overall market.