Docsity

Regression Analysis: Finding the Linear Relation between X and Y using Least-Square Method, Study notes of Statistics

Toggle sidebar
bg1
1
Introduction to Statistics
Lecture 10
October 6, 2005
Regression analysis
Regression line is the mathematical model for a
linear relation between X and Y
A regression line is of the form: Y=a+bX
‘a’ and ‘b’ are regression coefficients, while ‘a’ is
called the intercept, ‘b’ is referred as the slope
It is an estimation of the real relation and can be
used to give prediction on Y using given X values.
Regression analysis is to find values of ‘a’ and ‘b’
for a set of data under study
Least-square (errors) method
Regression (linear) model: Y=a+bX
At a given value X, the prediction given by
the regression line is:
For an observed value Y of the response
variable at this value X, the prediction error
measures how the model differs from the
reality (presented in the data).
bXaY +=
ˆ
Y(abX)
ˆ
YY YabX=−+ =−−−
L-S method (cont’d)
A data set on X and Y contains npairs
of real observed values (as
shown in a scatterplot).
For any “candidate” line (model), one
can evaluate the difference between
the model and data using
),( ii YX
()
2
ii
i
YabX−−
∑
L-S method (cont’d)
The least-square regression line is the
“best” model that is the “closest” to
the data.
Mathematicians have derived that the
L-S line coefficients can be
calculated using:
⎪
⎩
⎪
⎨
⎧
−=
=
aintercept
b slope
10
1
XbYb s
s
rb
X
Y
Interpreting the coefficients
Use the non-statistical language.
b1(the slope) estimates the increment
of Y when X increases one unit.
{Kalama Children: Height (in cm) and Age
(in months)
{Height:0.653 cm growth per month
Ageheight 653.093.64 +
=
Slope value One unit of X
Increment
pf3
pf4

Partial preview of the text

Download Regression Analysis: Finding the Linear Relation between X and Y using Least-Square Method and more Study notes Statistics in PDF only on Docsity!

Introduction to Statistics

Lecture 10 October 6, 2005

Regression analysis

„ Regression line is the mathematical model for a linear relation between X and Y „ A regression line is of the form: Y=a+bX „ ‘a’ and ‘b’ are regression coefficients, while ‘a’ is called the intercept , ‘b’ is referred as the slope „ It is an estimation of the real relation and can be used to give prediction on Y using given X values. „ Regression analysis is to find values of ‘a’ and ‘b’ for a set of data under study

Least-square (errors) method

„ Regression (linear) model : Y=a+bX „ At a given value X, the prediction given by the regression line is:

„ For an observed value Y of the response variable at this value X, the prediction error

measures how the model differs from the reality (presented in the data).

Y ˆ = a + bX

Y −Yˆ = Y − (a + bX)= Y − a −bX

L-S method (cont’d)

„ A data set on X and Y contains n pairs of real observed values (as shown in a scatterplot). „ For any “candidate” line (model), one can evaluate the difference between the model and data using

( Xi , Yi )

2 i i i

∑ Y^ −^ a^ − bX

L-S method (cont’d)

„ The least-square regression line is the “best” model that is the “ closest ” to the data. „ Mathematicians have derived that the L-S line coefficients can be calculated using:

intercept a

slopeb

0 1

1 b Y b X

s

s b r X

Y

Interpreting the coefficients

„ Use the non-statistical language. „ b 1 (the slope) estimates the increment of Y when X increases one unit. { Kalama Children: Height (in cm) and Age (in months)

{ Height : 0.653 cm growth per month

height = 64. 93 + 0. 653 Age

Slope value (^) Increment One unit of X

Interpreting … (cont’d)

„ b 0 (the intercept) estimates the value of Y when X=0. { Kalama Children: Height (in cm) and Age (in months)

{ Height : 64.93 cm at birth

height = 64. 93 + 0. 653 Age

Intercept value (^) X (age)=

Prediction

„ Given a regression line

„ : the predicted value of the response, corresponding to the value x. (called. Y-hat)

„ Most of the time, prediction is different from what is actually observed. ( prediction error )

„ Extrapolation happens when one tries to give prediction on values of X outside the data range.

Y = a + bX Y^ ˆ = a + bx

Regression and correlation

„ Regression estimates the effects of a unit increment in X on Y; „ Regression is between X and Y „ Regression coefficients do not reflect the strength of the relation

„ Correlation says nothing about the effects „ Correlation makes no distinction between X and Y „ Correlation measures the direction and strength of the relation r 2 can be used to evaluate the ‘fit’ of the regression line: the percentage of variation in Y can be explained by the variable X.

The “best” line is not perfect!

Residuals

For each pair of data , we calculate the residual (prediction error of the fitted model):

X

Y

Y

Yˆ^

( Xi ,Yi)

ei =Yi−Yˆ^ i=Yi−(b 0 +b 1 Xi )

e i

What we can do with residuals

„ Standard deviation of residuals (measuring the uncertainty in the prediction given by the model):

„ The R 2 (squared correlation):

the proportion of variation of Y that is accounted for by the model.

2

2 −

n s ei e

∑

∑ −

= − 2

2 2 ( )

1 Y Y

e R i

i

Residuals (cont’d)

„ Residual plots { Residuals versus the X variable { Residuals versus the predicted variable { Histogram of the residuals { Normal quantile plot of the residuals { Residuals versus a third variable { Residuals versus the (time) order that the data were collected.

Extrapolation

Using current data to predict future

outcome is extrapolation!

„ Terms { X outliers: observations outlying the overall pattern of the X-variable { Y outliers: observations outlying the overall pattern of the Y-variable { (Model) outliers: observations outlying the overall pattern of the X-Y association. „ Outliers can be detected in an residual plot, (only sometime, not always.) „ Influential points : observations that have substantial influence on the model fitted. „ Removing such observations will result in quite different models.

Outliers and influential points

REMOVED