Regression Analysis: By: Vaibhav Sahu
Regression Analysis: By: Vaibhav Sahu
Regression Analysis: By: Vaibhav Sahu
By:
Vaibhav Sahu
Regression
What
Why
How
Example Using R
What
Y f(X)
Y - Dependent on X
Y Dependent Variable, Response Variable, Effect
X Independent or Predictor Variable, Cause
Regression is all about creating a valid
relationship (mathematical equation or model)
between dependent and independent variables
Example: Relationship between demand of a
product and the price of the same (Price
Elasticity)
Why
Prediction, Forecasting
Understand Population response based on
sample
Time series analysis (Trend Analysis) to
know the future
Cause Effect Relation (but not necessary)
Applied in various domain like economics,
management, social sciences etc.
Classification
Linear Regression
Y = 2+3*x
Non Linear Regression
Y = 2+3*x+x^2
Linear Regression
Classification
Univariate : One Dependent variable(Y)
Y=a+bX
Linearity
Linearity in Variables
Y = a+bX
Y a bX cX 2 de X
(Non Linear in
Variables but Linear in Parameters)
Linearity in Parameters
Y = a+bX
Y a bX cX 2 de X
Y a b2 X
(Non Linear in parameters but
Linear in Variables)
Population Regression
Function
Passes through condition means E(Y|
X i)
E(Y|Xi) = f(Xi)
Considering
E (Y | X ) Linearity
X
i
Yi 1 2 X i u i
Y
(continued)
Y f(x)
ui
Slope = 1
Random Error for this
x value
Predicted
Value
of Y for Xi
Intercept
= 0
xi
Individual
person's
marks
X
10
Yi 1 2 X i
For many such samples
many
SRFs
can
be
created
u
Yi Y
i
i
(continued)
Yi 1 2 X i ui
Observed
Value
of y for xi
ui
Slope = 1
Random Error for this
x value
Predicted
Value
of Y for Xi
Intercept
= 0
xi
X
12
Our Objective
So our objective is to
Estimate the PRF
Yi 1 2 X i u i
Yi 1 2 X i ui
But Min
we dou 2 (Y Y ) 2
i i i
Min ui
(Yi Yi )
Min ui
(Yi 1 2 X i )
( X X )(Y Y )
(X X )
i
and
1 Y 2 X
1 and2 are called least square
Example Using R
Regression.R
Regression.R
Residual Plots