Docsity

Statistical Inference for Simple Linear Regression: Estimation, Confidence, Tests, Study notes of Statistics

Toggle sidebar
bg1
Inference for Regression
•The simple linear regression model
•Estimating regression parameters;
•Confidence intervals and significance tests for
regression parameters
•Inference about prediction
•Analysis of variance for regression
•The regression fallacy
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
(x1, y1),...,(xn, yn)
For example,
•x=father’s height, y=son’s height
•x=midterm score, y=final score
•x=temperature, y=yield
The values of xdefine different groups of subjects,
which we think of as belonging to subpopulations:
one for each possible value of x.
Let µy|xand σ2
y|xdenote the mean and variance of y
in the subpopulation with a certain value of x.
Under the linear regression model with equal
variance,µy|x=β0+β1xand σ2
y|x=σ2, possibly
after transformation.
2
Simple Linear Regression Model
The simple linear regression model states that the
response variable yand the explanatory variable
xhave a linear relationship of the form
y=β0+β1x+²
where
•β0and β1are the y-intercept and the slope of
the true population regression line.
•²∼N(0, σ)
•The ²icorresponding to the pairs (xi, yi) are
independent of each other
•Given x,yhas mean β0+β1xand variance σ2
E(y|x) = µy|x=β0+β1x
is called the population regression line.
Var(y|x) = σ2
y|x=σ2
3
Estimating the Regression Parameters by
Least-Squares
Given a sample of npairs of observations
(x1, y1), . . . , (xn, yn), we use the method of least
squares to estimate the unknown parameters β0,
β1, and σ. This gives us the fitted line
ˆy=b0+b1x
where
•b1=
P
(xi−¯x)yi
P
(xi−¯x)2=rsy
sxis the estimate of β1
•b0= ¯y−b1¯xis the estimate of β0
4
pf3
pf4
pf5

Partial preview of the text

Download Statistical Inference for Simple Linear Regression: Estimation, Confidence, Tests and more Study notes Statistics in PDF only on Docsity!

Inference for Regression

  • The simple linear regression model
  • Estimating regression parameters;
  • Confidence intervals and significance tests for regression parameters
  • Inference about prediction
  • Analysis of variance for regression
  • The regression fallacy

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,

  • x=father’s height, y=son’s height
  • x=midterm score, y=final score
  • x=temperature, y=yield The values of x define different groups of subjects, which we think of as belonging to subpopulations: one for each possible value of x. Let μy|x and σ y^2 |x denote the mean and variance of y in the subpopulation with a certain value of x. Under the linear regression model with equal variance, μy|x = β 0 + β 1 x and σ y^2 |x = σ^2 , possibly after transformation.

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

  • β 0 and β 1 are the y-intercept and the slope of the true population regression line.
  • ≤ ∼ N (0, σ)
  • The ≤i corresponding to the pairs (xi, yi) are independent of each other
  • Given x, y has mean β 0 + β 1 x and variance σ^2

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

  • b 1 =

P(xi−x¯)yi P(xi−x¯) 2 = r s syx is the estimate of β 1

  • b 0 = ¯y − b 1 x¯ is the estimate of β 0

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

  • The sample is an SRS from the population
  • There is a linear relationship in the population We check this condition by assessing the linearity of a scatterplot of the sample data.
  • The standard deviation of the responses about the population line is the same for all values of the explanatory variable. We check this by plotting the residuals and observing whether or not the spread of the observations around the least-squares line is roughly uniform as x varies.
  • The response varies Normally about the population regression line. We check this condition by observing a Normal quantile plot of the residuals. Note that the last three conditions are statements about the population that cannot be verified directly. We use the sample to assess their reasonability.

6

CIs for Regression Parameters

Under the assumption that ≤ ∼ N (0, σ),

b 1 ∼ N

β 1 , √∑ σ (xi − x¯)^2

b 0 ∼ N

β 0 , σ

n

  • x¯

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

1 +^1

n

  • (x

∗ (^) − ¯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.

  • As the explanatory variable x changes, it “pulls” the response with it along the regression line. This is the variation along the line or regression sum of squares:

SS(Regression) =

∑^ n

i=

(ˆyi − y¯)^2

  • When x is held fixed, y still varies because not all individuals who share a common x have the same response y. This is the variation about the line or residual sum of squares:

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)

  • n ︸ ︷︷ ︸ − 2 SS(Residual)

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?