Simple Linear Regression
Simple Linear Regression
Regressand Regressor
Predictand Predictor
Response Variable
Regression
Models
One More than One
independent independent
variable variable
Simple Multiple
Regression Regression
Y 0 1 X 1
• Nonlinear regression.
1
Y 0 X 2 3
1 2 X 1
Linear Regression
Y 1 1 X1 2 X1 X 2 3 X 22
Regression Model Development
Framework for SLR model development
Assumptions
The method of least squares gives the best equation under the
assumptions stated below (Harter 1974, 1975):
The regression model is linear in regression parameters.
The explanatory variable, X, is assumed to be non-stochastic (i.e., X is
deterministic).
The conditional expected value of the residuals, E(i|Xi), is zero.
In case of time series data, residuals are uncorrelated, that is, Cov(i,
j) = 0 for all i j.
The residuals, i, follow a normal distribution.
The variance of the residuals, Var(i|Xi), is constant for all values of
Xi. When the variance of the residuals is constant for different values
of Xi, it is called homoscedasticity. A non-constant variance of
residuals is called heteroscedasticity
OLS Estimation
In ordinary least squares, the objective is find the optimal values of 0 and 1
that will minimize the Sum of Squared Errors (SSE) given in belwo Eq:
n n
SSE i2 Yi β 0 β1X i 2
i 1 i 1
To find the optimal values of 0 and 1 that will minimize SSE, we have to
equate the partial derivative of SSE with respect to 0 and 1 to zero.
SSE n n n
2 Yi β 0 β1Xi 2 nβ 0 β1 Xi Yi 0
β 0 i 1 i 1 i 1
SSE
β1
n
i 1
n
2Xi Yi β 0 β1Xi 2 Xi Yi β 0 Xi β1Xi2 0
i 1
OLS Estimation
0 y 1 X
n n
X i Yi X i Y X i (Yi Y )
i 1 i 1
1
n n
2
X i X i X Xi (Xi X )
i 1 i 1
Example :
Where is the predicted value of Y for a given value of Xi.
Yi
.
The equation can be interpreted as follows: for every one
percentage increase in grade 10 marks, the salary of the
MBA students will increase at the rate of 3076.1774 on an
average. The notations
Solution Continued
are used to denote that these are estimated values
0 and 1
of the regression coefficients from the sample of 50
students.
The Microsoft Excel output for SLR model is shown in
Table
The above measures and tests are essential, but not exhaustive.
Coefficient of Determination (R-Square or R2)
Yi
0 1 X i i
Variation in Y Variation in Y explained Variation in Y not explained
by the model by the model
In absence of the predictive model for Yi, the users will use the
mean value of Yi. Thus, the total variation is measured
as the
difference between Yi and mean value of Yi (i.e.,Yi Y
- ).
Description of total variation, explained
variation and unexplained variation
Total Variation (SST) ( ) Total variation is the difference between the actual value
Yi Y and the mean value.
Variation explained by the model ( ) Variation explained by the model is the difference
Yi Y between the estimated value of Yi and the mean value of
Y
Variation not explained by model ( ) Variation not explained by the model is the difference
Yi Yi between the actual value and the predicted value of Y i
(error in prediction)
The relationship between the total variation, explained variation and
the unexplained variation is given as follows:
Yi Y Yi Y Yi Yi
Total Variation in Y Variation in Y explained by the model Variation in Y not explained by the model
where SST is the sum of squares of total variation, SSR is the sum of
squares of variation explained by the regression model and SSE is the
sum of squares of errors or unexplained variation.
Coefficient of Determination or R-Square
The coefficient of determination (R2) is given by
2
Yi Y
2 Explained variation SSR
Coefficient of determination R
Total variation SST 2
Yi Y
In above Eq. Se is the standard error of estimate (or standard error of the
residuals) that measures the accuracy of prediction and is given by
n n
2 2
(Yi Y i ) i
Se i 1 i 1
n2 n2
H0: 1 = 0
HA: 1 0
• The corresponding t-statistic is given as
1 1 1 0 1
t
Se ( 1) Se ( 1 ) Se ( 1 )
Residual Analysis
1 ( X i X )2
• Where the term Se
n
n is the standard error of
2
(Xi X )
E(Y|X). i 1
Prediction Interval for the Value of Y for a
Given X
The prediction interval of Yi for a given value of Xi is given by
1 ( X i X )2
Yi t / 2,n 2 Se 1
n n
2
( Xi X )
i 1
( X i X )2
where the term, Se 1is the standard error of Yi
1
n
n
2
for a given Xi value
i 1
(Xi X )
For large n, the confidence interval of E(Y|X) will converge to
Yi t / 2, n 2 Se
This is because, as n , the term
1 ( X i X )2
1
n n
( Xi X )
2 converges to 1
i 1