



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1
Simple Linear Regression
Earlier in the course we discussed how to find the best fitting line for bivariate data. Here, we consider that problem from the perspective of statistical inference. Suppose we observe pairs of observations (x 1 , y 1 ),... , (xn, yn) For example,
2 Simple Linear Regression Model
The simple linear regression model states that the response variable y and the explanatory variable x have a linear relationship of the form
y = β 0 + β 1 x + ≤
where
E(y|x) = μy|x = β 0 + β 1 x
is called the population regression line.
Var(y|x) = σ^2 y|x = σ^2
Estimating the Regression Parameters by Least-Squares
Given a sample of n pairs of observations (x 1 , y 1 ),... , (xn, yn), we use the method of least squares to estimate the unknown parameters β 0 , β 1 , and σ. This gives us the fitted line
yˆ = b 0 + b 1 x
where
P(xi−x¯)yi P(xi−x¯) 2 = r s syx is the estimate of β 1
Recall that the residual is the difference between the observed value and the predicted value:
ei = yi − (b 0 + b 1 xi) = yi − yˆi
The sample variance of ei can be used to estimate σ^2 :
s^2 =
(yi − yˆi)^2 n − 2
s is called the regression standard error and it has n − 2 degrees of freedom.
Why n − 2 degrees of freedom?
5
Conditions for regression inference
6
CIs for Regression Parameters
Under the assumption that ≤ ∼ N (0, σ),
b 1 ∼ N
β 1 , √∑ σ (xi − x¯)^2
b 0 ∼ N
β 0 , σ
n
2 ∑ (xi − x¯)^2
We don’t know σ, so we will use s to estimate it. This leads to t-confidence intervals for β 0 and β 1.
A level (1 − α) confidence interval for β 0 is given by
(b 0 − t∗^ SE(b 0 ), b 0 + t∗^ SE(b 0 ))
where t∗^ is the upper α/2 critical value of the tn− 2 distribution and
SE(b 0 ) = s
n +^
∑ x¯^2 (xi − x¯)^2
A level (1 − α) confidence interval for β 1 is given by
(b 1 − t∗^ SE(b 1 ), b 1 + t∗^ SE(b 1 ))
where t∗^ is the upper α/2 critical value of the tn− 2 distribution and
SE(b 1 ) = √∑ s (xi − ¯x)^2
CIs for the Mean Response
For a specific value of x, say x∗, the assumption is that y comes from a N (μy|x∗ , σ) distribution, where
μy|x∗^ = β 0 + β 1 x∗
Plugging in our estimates of β 0 and β 1 , μy|x∗^ is estimated by ˆμy|x∗ = b 0 + b 1 x∗, and a level (1 − α) confidence interval for the mean response μy|x∗ is given by
μˆy|x∗^ ± t∗SE(ˆμy|x∗^ )
where t∗^ is the upper α/2 critical value of the tn− 2 distribution and
SE(ˆμy|x∗^ ) = s
n +^
∑(x∗^ −^ x¯)^2 (xi − x¯)^2
13
Prediction Interval for a Future Observation
Suppose we want to predict a specific observation value at x = x∗. At each x∗, y ∼ N (μy|x∗ , σ) We want to predict a y drawn from this distribution. Our best guess is the estimated mean of the distribution,
yˆ = ˆμy|x∗ = b 0 + b 1 x∗
14
How accurate is this estimate?
The error here will be larger than the error for the mean response, SE(ˆμy|x∗ ), because there is error in estimating μy|x∗ as well as error in drawing a value from the normal distribution N (μy|x∗ , σ).
A level (1 − α) prediction interval for a future observation y corresponding to x∗^ is given by
ˆy ± t∗sˆy
where t∗^ is the upper α/2 critical value of the tn− 2 distribution and
syˆ = s
n
∗ (^) − ¯x) 2 ∑ (xi − ¯x)^2
Analysis of Variance for Regression Analysis of variance is the term for statistical analyses that break down the variation in data into separate pieces that correspond to different sources of variation. In the regression setting, the observed variation in the responses comes from two sources.
SS(Regression) =
∑^ n
i=
(ˆyi − y¯)^2
SS(Residual) =
∑^ n
i=
(yi − yˆi)^2
The ANOVA Equation
It turns out that SS(Residual) and SS(Regression) together account for all the variation in y:
∑^ n
i=
(yi − y¯)^2 ︸ ︷︷ ︸ SS(Total)
∑^ n
i=
(ˆyi − ¯y)^2 ︸ ︷︷ ︸ SS(Regression)
∑^ n
i=
(yi − yˆi)^2 ︸ ︷︷ ︸ SS(Residual)
The degrees of freedom break down in a similar manner:
n ︸ ︷︷ ︸ − 1 SS(Total)
SS(Regression)
Dividing a sum of squares by its degrees of freedom gives a mean square (MS).
MS(Residual) = SS(Residual) df(Residual)
∑n i=1(yi^ −^ ˆyi)^2 n − 2
= s^2
R^2 = Regression SS Total SS
= r^2
17
The ANOVA F Statistic
As an alternative test of the hypothesis: H 0 : β 1 = 0, we use the F statistic:
F =
MS(Regression) MS(Residual)
=
SS(Regression)/df(Regression) SS(Residual)/df(Residual)
=
b 1 SEb 1
= t^2
Under H 0 , F ∼ F 1 ,n− 2 where F 1 ,n− 2 is an F distribution with 1 and n − 2 degrees of freedom.
18
The Regression Fallacy
Sir Francis Galton (1822–1911), who was the first to apply regression to biological and psychological data, looked at examples such as the heights of children versus the heights of their parents. He found that the taller-than-average parents tended to have children who were also taller than average, but not as tall as their parents. Galton called this fact “regression toward mediocrity”.
As another example, students who score at the bottom on the first exam in a course are likely to do better on the second exam. Is it because they work harder?