0% found this document useful (0 votes)
9 views3 pages

SimpleLineaReg Example

Uploaded by

RyzoSan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

SimpleLineaReg Example

Uploaded by

RyzoSan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

The Model

• The first order linear model


Simple Linear Regression
y  b0  b1x  e
Example
y = dependent variable b0 and b1 are unknown population
x = independent variable y parameters, therefore are estimated
from the data.
b0 = y-intercept
b1 = slope of the line
Rise
e = error variable b1 = Rise/Run
b0 Run
x
1 2

The Estimated Coefficients The Simple Linear Regression Line


Alternate formula for the slope b1
To calculate the estimates of the slope and
intercept of the least squares line , use the sy • Example:
formulas: b1  r
sx – A car dealer wants to find
the relationship between
SS xy Car Odometer Price
b1  The regression equation that estimates the odometer reading and 1 37388 14636
SS xx
the equation of the first order linear model the selling price of used cars. 2 44758 14122
b0  y  b1 x is: 3 45833 14016
– A random sample of 100
  x   y 
4 30862 15590
SS xy   xi yi 
i i cars is selected, and the data 5 31705 15568
n recorded. 6 34010 14718

 x 
2 ŷ  b0  b1 x – Find the regression line.
.
.
.
Independent
.
.
Dependent
.
SS xx   x variable x variable y
i
2
i   (n  1) s 2
x . . .
n
3 4
The Simple Linear Regression Line Assessing the Model
• Solution • The least squares method will produces a
– Solving by hand: Calculate a number of statistics regression line whether or not there is a linear
 x 
2

x  36,009 .45; SS xx   xi 2 
i
 43,528, 690 relationship between x and y.
n
• Consequently, it is important to assess how well
y  14 ,822 .823 ; SS xy   ( xi yi )  
xi  yi
 2, 712,511
n the linear model fits the data.
where n = 100.
SS xy 2, 712,511
• Several methods are used to assess the model.
b1 
(n  1) s 2
x

43,528, 690
 .06232 All are based on the sum of squares for errors,
b0  y  b1 x  14,822.82  (.06232)(36, 009.45)  17, 067 SSE.
ŷ  b0  b1x  17,067  .0623 x 5 6

Sum of Squares for Errors Standard Error of Estimate


– This is the sum of differences between the points – The mean error is equal to zero.
and the regression line. – If se is small the errors tend to be close to zero
– It can serve as a measure of how well the line fits the (close to the mean error). Then, the model fits the
data well.
data. SSE is defined by – Therefore, we can, use se as a measure of the
n
suitability of using a linear model.
SSE  (y  ŷ ) .
i 1
i i
2
– An estimator of se is given by se
– A shortcut formula
S tan dard Error of Estimate
SSE   yi2 b0  yi  b1  xi yi se 
SSE
7 n2 8
Standard Error of Estimate,
Example Testing the Slope
• Example: • We can draw inference about b1 from b1 by testing
– Calculate the standard error of estimate for the previous
example and describe what it tells you about the model fit.
H0: b1 = 0
H1: b1 = 0 (or < 0,or > 0)
• Solution
– The test statistic is

SSE  9, 005, 450 b1  b1 se


t where sb1 
SSE 9, 005, 450 s b1 SS xx
se    303.13
n2 98
It is hard to assess the model based The standard error of b1.
on se even when compared with the – If the error variable is normally distributed, the statistic
mean value of y.
9
is Student t distribution with d.f. = n-2. 10
s e  303.1 y  14,823

Testing the Slope, Testing the Slope,


Example Example
• Solving by hand
• Example – To compute “t” we need the values of b1 and sb1.
– Test to determine whether there is enough evidence
b1  .0623
to infer that there is a linear relationship between the
se 303.1
car auction price and the odometer reading for all sb1  
(99)( 43,528,690)
 .00462
(n  1) s x2
three-year-old Tauruses in the previous example .
b1  b1  .0623  0
Use a = 5%. t
sb1

.00462
 13.49

– The rejection region is t > t.025 or t < -t.025 with n = n-2 = 98.
Approximately, t.025 = 1.984
11 12

You might also like