Docsity

Notes on Simple Linear Regression Model | STA 108, Study notes of Statistics

Toggle sidebar
bg1
Information: Chapter 1
Simple linear regression model:
The data consist of npairs of observations (X1, Y1), ..., (Xn, Yn). The model is
Yi=β0+β1Xi+εi, i = 1, ..., n,
where ε1, ..., εnare independent, E(εi) = 0 and V ar(εi) = σ2. From this it follows that E(Yi) =
β0+β1Xi,V ar(Yi) = σ2and that Y1, ..., Ynare independent.
Estimation of β0and β1(least squares method)
For this method we find the straight line (equivalent to finding its intercept b0and its slope β1)
which fits the data the closest. Let
Q=
1≤i≤n
(Yi−b0−b1Xi)2.
The least squares method minimizes Qwith respect to b0and b1. Calculus tells us this is achieved
by setting the derivatives of Qwith respect to b0and b1to zero and then solving the simultaneous
equations, i.e., solve
∂Q
∂b0
= 0,∂Q
∂b1
= 0.
It can be shown these lead to the equations
nb0+Xib1=Yi
Xib0+X2
ib1=XiYi.
These equations are called the normal equations and the solutions are given by
b1=(Xi−X)(Yi−Y)
(Xi−X)2, b0=Y−b1X.
Note that b0estimates β0and b1estimates β1. So the fitted regression line is ˆ
Y=b0+b1X.
For the Housing data, we have
n= 19,X= 15.719,Y= 75.211,(Xi−X)2= 40.805,(Yi−Y)2= 556.078,(Xi−X)(Yi−
Y) = 120.001.
So b1=120.001
40.805 = 2.941 and b1= 75.211 −(2.941)(15.719) = 28.981.
1
pf3

Partial preview of the text

Download Notes on Simple Linear Regression Model | STA 108 and more Study notes Statistics in PDF only on Docsity!

Information: Chapter 1

Simple linear regression model:

The data consist of n pairs of observations (X 1 , Y 1 ), ..., (Xn, Yn). The model is

Yi = β 0 + β 1 Xi + εi, i = 1, ..., n,

where ε 1 , ..., εn are independent, E(εi) = 0 and V ar(εi) = σ^2. From this it follows that E(Yi) = β 0 + β 1 Xi, V ar(Yi) = σ^2 and that Y 1 , ..., Yn are independent.

Estimation of β 0 and β 1 (least squares method)

For this method we find the straight line (equivalent to finding its intercept b 0 and its slope β 1 ) which fits the data the closest. Let

Q =

1 ≤i≤n

(Yi − b 0 − b 1 Xi)^2.

The least squares method minimizes Q with respect to b 0 and b 1. Calculus tells us this is achieved by setting the derivatives of Q with respect to b 0 and b 1 to zero and then solving the simultaneous equations, i.e., solve

∂Q ∂b 0 = 0,

∂Q

∂b 1 = 0.

It can be shown these lead to the equations

nb 0 +

Xib 1 =

Yi ∑ Xib 0 +

X^2 i b 1 =

XiYi.

These equations are called the normal equations and the solutions are given by

b 1 =

∑(X

∑i^ −^ X)(Yi^ −^ Y^ ) (Xi − X)^2 , b 0 = Y − b 1 X.

Note that b 0 estimates β 0 and b 1 estimates β 1. So the fitted regression line is Yˆ = b 0 + b 1 X. For the Housing data, we have n = 19, X = 15. 719 , Y = 75. 211 ,

(Xi − X)^2 = 40. 805 ,

(Yi − Y )^2 = 556. 078 ,

(Xi − X)(Yi − Y ) = 120. 001. So b 1 = (^12040) .. 805001 = 2. 941 and b 1 = 75. 211 − (2.941)(15.719) = 28. 981.

So the fitted line is Yˆ = 28.981 + 2. 941 X. So when X = 18. 3 , estimated selling price is Yˆ = 28 .981 + (2.941)(18.3) = 83. 39.

Fitted response and residuals

Before we can estimate the variance σ^2 , we need concepts of fitted Y -values and residuals. The fitted Y values are Yˆi = b 0 + b 1 Xi, i = 1, ..., n. The residuals are defined by ei = Yi − Yˆi = Yi − (b 0 + b 1 Xi). Note that εi = Yi − (β 0 + β 1 Xi). Now εi is unknown since we do not know β 0 and β 1. However, if we substitute β 0 and β 1 by its estimates b 0 and b 1 we get the residual ei = Yi − (b 0 + b 1 Xi). So ei is an estimate of εi. The fact that {ei} estimate {εi} is a very useful fact and we will see this again in chapter 3. Here are some properties of the estimated regression line and the residuals: i)

ei = 0 ii) ∑^ e^2 i ≤ ∑(Yi − u 0 − u 1 Xi)^2 for any real numbers u 0 and u 1 , iii) ∑^ Yi = ∑^ Yˆi, iv)

Xiei = 0, v) ∑^ Yˆiei = 0, vi) the regression line passes thorough the point of averages (X, Y ).

Residual sum of squares

The residual sum of squares is defined to be SSE = ∑^ e^2 i. Here are two important computing formulas

SSE =

(Yi − Y )^2 − b^21

(Xi − X)^2 , SSE =

Y i 2 − b 0

Yi − b 1

XiYi.

Here is an important fact

E(SSE) = (n − 2)σ^2.

Define MSE = SSE n− 2. Then E(MSE) = σ^2. So MSE is an estimate of σ^2. For the Housing data, using the computing formula, we have SSE = ∑(Yi − Y )^2 − b^21 ∑(Xi − X)^2 = 203. 17 and MSE = SSE n− 2 = (^20319) −.^172 = 11. 95. So an estimate of σ^2 here is 11.95.

Normal regression model

This normal regression model is Yi = β 0 + β 1 Xi + εi, i = 1, ..., n, where ε 1 , ..., εn are assumed to be independent N(0, σ^2 ). This means Y 1 , ..., Yn are independent and, for each i, Yi is normally distributed with mean β 0 + β 1 Xi and variance σ^2.