Lecture 6 Simple Linear Regression
Lecture 6 Simple Linear Regression
Simple Regression
Simple regression analysis is a statistical tool That
gives us the ability to estimate the mathematical
relationship between a dependent variable (usually
called y) and an independent variable (usually
called x).
The dependent variable is the variable for which
we want to make a prediction.
While various non-linear forms may be used,
simple linear regression models are the most
common.
Introduction
The primary goal of quantitative
analysis is to use current
information about a
phenomenon to predict its future
behavior. lot size Man-hours
30 73
Current information is usually in 20 50
60 128
the form of a set of data. 80 170
40 87
In a simple case, when the data 50 108
form a set of pairs of numbers, 60 135
we may interpret them as 30 69
70 148
representing the observed values 60 132
of an independent (or predictor )
variable X and a dependent ( or
response) variable Y.
Introduction
The goal of the analyst
who studies the data is to Statistical relation between Lot size and Man-Hour
180
y f (x) 140
120
Man-Hour
80
40
variable x. 20
0
0 10 20 30 40 50 60 70 80 90
Lot size
Regression Function
The statement that the relation
between X and Y is statistical
should be interpreted as providing
the following guidelines:
1. Regard Y as a random variable.
2. For each X, take f (x) to be the
expected value (i.e., mean value) of
y.
3. Given that E (Y) denotes the
expected value of Y, call the
equation
E (Y ) f ( x)
the regression function.
Pictorial Presentation of Linear Regression
Model
Historical Origin of Regression
Regression Analysis was
first developed by Sir
Francis Galton, who
studied the relation
between heights of sons
and fathers.
Heights of sons of both tall
and short fathers appeared
to “revert” or “regress” to
the mean of the group.
Construction of Regression Models
Selection of independent variables
Since reality must be reduced to manageable proportions
whenever we construct models, only a limited number of
independent or predictor variables can or should be included in a
regression model. Therefore a central problem is that of
choosing the most important predictor variables.
Functional form of regression relation
Sometimes, relevant theory may indicate the appropriate
functional form. More frequently, however, the functional form
is not known in advance and must be decided once the data have
been collected and analyzed.
Scope of model
In formulating a regression model, we usually need to restrict
the coverage of model to some interval or region of values of the
independent variables.
Uses of Regression Analysis
Regression analysis serves Three major purposes.
1.Description
2.Control
3.Prediction
The several purposes of regression analysis frequently
overlap in practice
Formal Statement of the Model
General regression model
n n 2
SSE ( yi yˆ i ) 2 y b0 b1 x
i 1 i 1
Regression Line
Using calculus, we obtain estimating formulas:
or
n n n n
(x i x )( yi y ) n xi yi xi yi
b1 i 1
n
i 1
n
i 1
n
i 1
(x
i 1
i x )2 n xi2 ( xi ) 2
i 1 i 1
Sy
b1 r
Sx
b0 y b1 x
Estimation of Mean Response
Fitted regression line can be used to estimate the
mean value of y for a given value of x.
Example
The weekly advertising expenditure (x) and weekly sales
(y) are presented in the following table.
y x
1250 41
1380 54
1425 63
1425 54
1450 48
1300 46
1400 62
1510 61
1575 64
1650 71
Point Estimation of Mean Response
From previous table we have:
n 10 x 564 x 32604 2
n xy x y 10(818755) (564)(14365)
b1 10.8
n x 2 ( x ) 2 10(32604) (564) 2
ŷ 828 10.8x
This means that if the weekly advertising expenditure is
Sales 828 10.8 Expenditur e
increased by $1 we would expect the weekly sales to
increase by $10.8.
Point Estimation of Mean Response
Fitted values for the sample data are obtained by
substituting the x value into the estimated regression
function.
For example if the advertising expenditure is $50, then
the estimated Sales is:
ŷi
Residuals are highly useful for studying whether a
ei yi yˆi
given regression model is appropriate for the data at
hand.
Example: weekly advertising
expenditure
1 1
s y. x i n2 i i
ˆ
2
To estimate ,
2 2
e ( y y )
use
n2
s estimates the standard
s y. xdeviation
s y. x
2 of the error
term in the statistical model for simple linear
regression.
Regression Standard Error
y f (x)
Conditions for Regression Inference
You can fit a least-squares line to any set of
explanatory-response data when both variables are
quantitative.
If the scatter plot doesn’t show an approximately
linear pattern, the fitted line may be almost useless.
Conditions for Regression Inference
The simple linear regression model, which is the basis
for inference, imposes several conditions.
We should verify these conditions before proceeding
with inference.
The conditions concern the population, but we can
observe only our sample.
Conditions for Regression Inference
In doing Inference, we assume:
1. The sample is from the population.
2. There is a linear relationship in the population.
1. We can not observe the population , so we check the scatter
plot of the sample data.
3. The standard deviation of the responses about the
population line is the same for all values of the
explanatory variable.
1. The spread of observations above and below the least-
squares line should be roughly uniform as x varies.
Conditions for Regression Inference
Plotting the residuals against the explanatory variable
is helpful in checking these conditions because a
residual plot magnifies patterns.
Analysis of Residual
To examine whether the regression model is
appropriate for the data being analyzed, we can
check the residual plots.
Residual plots are:
Plot a histogram of the residuals
Plot residuals against the fitted values.
Plot residuals against the independent variable.
Plot residuals over time if the data are chronological.
Analysis of Residual
A histogram of the residuals provides a check on
the normality assumption. A Normal quantile plot
of the residuals can also be used to check the
Normality assumptions.
Regression Inference is robust against moderate
lack of Normality. On the other hand, outliers and
influential observations can invalidate the results
of inference for regression
Plot of residuals against fitted values or the
independent variable can be used to check the
assumption of constant variance and the aptness of
the model.
Analysis of Residual
Plot of residuals against time provides a check on the
independence of the error terms assumption.
Assumption of independence is the most critical one.
Residual plots
The residuals should
have no systematic
pattern.
The residual plot to right Degree Days Residual Plot
shows a scatter of the 1
points with no 0.5
individual observations
Residuals
0
or systematic change as 0 20 40 60
-0.5
x increases.
-1
Degree Days
Residual plots
The points in this
residual plot have a
curve pattern, so a
straight line fits poorly
Residual plots
The points in this plot
show more spread for
larger values of the
explanatory variable x,
so prediction will be less
accurate when x is large.