regression.ppt

25 views 16 slides Aug 22, 2023
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

HFT


Slide Content

15: Linear Regression
Expected change in Y per unit X

Introduction
(p. 15.1)
•X= independent (explanatory) variable
•Y= dependent (response) variable
•Use instead of correlation
when distribution of Xis fixed by researcher (i.e.,
set number at each level of X)
studying functional dependency between X and Y

Illustrative data (bicycle.sav)
(p. 15.1)
•Same as prior chapter
•X= percent receiving
reduce or free meal
(RFM)
•Y= percent using
helmets (HELM)
•n= 12 (outlier
removed to study
linear relation)100806040200
60
50
40
30
20
10
0
X - % Receiving Reduced Fee School Lunch

Regression Model (Equation)
(p. 15.2)slope sline' therepresents
intercept sline' therepresents
given aat of average predicted represents ˆ
where
ˆ
b
a
XYy
bXay
“y hat”

How formulas determine best line
(p. 15.2)
•Distance of points
from line =
residuals(dotted)
•Minimizes sum of
square residuals
•Least squares
regression line100806040200
60
50
40
30
20
10
0
X - % Receiving Reduced Fee School Lunch

Formulas for Least Squares Coefficients
with Illustrative Data (p. 15.2 –15.3)539.0
67.7855
1333.4231



XX
XY
SS
SS
b 49.47)8333.30)(539.0(8833.30  xbya
SPSS output:

Alternative formula for slopeX
Y
s
rs
b

Interpretation of Slope (b)
(p. 15.3)
•b= expected change in Y
per unit X
•Keep track of units!
–Y= helmet users per 100
–X= % receiving free lunch
•e.g., b of –0.54 predicts
decrease of 0.54 units of Y
for each unit X100806040200
60
50
40
30
20
10
0
X - % Receiving Reduced Fee School Lunch
Intercept
1 Unit X
Slope

Predicting Average Y
•ŷ= a+ bx
Predicted Y= intercept + (slope)(x)
HELM = 47.49 + (–0.54)(RFM)
•What is predicted HELM when RFM = 50?
ŷ= 47.49 + (–0.54)(50) = 20.5
Average HELM predicted to be 20.5 in neighborhood
where 50% of children receive reduced or free meal
•What is average Y when x= 20?
ŷ= 47.49 +(–0.54)(20) = 36.7

Confidence Interval for Slope Parameter
(p. 15.4)
95% confidence Interval for ß =
where
b = point estimate for slope
t
n-2,.975= 97.5
th
percentile (from ttable or StaTable)
se
b= standard error of slope estimate (formula 5)))((
975,.2 bn
setb


|
XX
xY
b
SS
se
se 2
)(
|



n
SSbSS
se
XYYY
xY
standard error of regression

Illustrative Example (bicycle.sav)
•95% confidence interval for 
= –0.54 ±(t
10,.975)(0.1058)
= –0.54 ±(2.23)(0.1058)
= –0.54 ±0.24
= (–0.78, –0.30)

Interpret 95% confidence interval
Model:
Point estimate for slope (b) = –0.54
Standard error of slope (se
b) = 0.24
95% confidence interval for = (–0.78, –0.30)
Interpretation:
slope estimate = –0.54 ±0.24
We are 95% confident the slope parameter falls
between –0.78 and –0.30

Significance Test
(p. 15.5)
•H
0: ß = 0
•t
stat(formula 7) with df = n–2
•Convert t
stat to p value09.5
1058.0
539.0



b
stat
se
b
t
df =12 –2 = 10
p= 2×area beyond t
staton t
10
Use ttable andStaTable

Regression ANOVA
(not in Reader & NR)
•SPSS also does an analysis of variance on regression model
•Sum of squares of fitted values around grand mean = (ŷ
i–ÿ)²
•Sum of squares of residuals around line = (y
i–ŷ
i)²
•F
statprovides same pvalue as t
stat
•Want to learn more about relation between ANOVA and regression?
(Take regression course)

Distributional Assumptions
(p. 15.5)
•Linearity
•Independence
•Normality
•Equal varianceX
Y
Regression Line
Distribution of Y

Validity Assumptions
(p. 15.6)
•Data = farr1852.sav
X= mean elevation above sea level
Y= cholera mortality per 10,000
•Scatterplot (right) shows
negative correlation
•Correlation and regression
computations reveal:
r= -0.88
ŷ= 129.9 + (-1.33)x
p= .009
•Farr used these results to support
miasma theory and refute
contagion theory
–But data not valid (confounded by
“polluted water source”)Mean Elevation of the Ground above the Higwater Mark
4003002001000
Mean mortality from Cholera per 10,000
200
100
80
60
40
20
10
8
6
Tags