Escolar Documentos
Profissional Documentos
Cultura Documentos
Regression
Outline
• Simple linear regression model
– Model parameters
– Distribution of error terms
• Estimation of regression parameters
– Method of least squares
– Maximum likelihood
Data for Simple Linear
Regression
• Yi = b0 + b1Xi + ei
• b0 is the intercept
• b1 is the slope
• ei is a random error term
– E(ei)=0 and s2(ei)=s2
– ei and ej are uncorrelated
Simple Linear Normal Error
Regression Model
• Yi = b0 + b1Xi + ei
• b0 is the intercept
• b1 is the slope
• ei is a Normally distributed random
error with mean 0 and variance σ2
• ei and ej are uncorrelated → indep
Model Parameters
• β0 : the intercept
• β1 : the slope
• σ2 : the variance of the error term
Features of Both
Regression Models
• Yi = β0 + β1Xi + ei
• Yi = β0 + β1Xi + ei
• Ŷi = b0 + b1Xi
– b0 is the estimated intercept
– b1 is the estimated slope
• ei : residual for ith case
• ei = Yi – Ŷi = Yi – (b0 + b1Xi)
Ŷ82=b0 + b182 e82=Y82-Ŷ82
X=82
Plot the residuals
Continuation of pisa.sas
Using data set from output statement
b1
(X X )(Y Y )
i i
(X X )
i
2
b 0 Y b1 X
• These are also maximum likelihood
estimators for Normal error model,
see KNNL pp 30-32
Maximum Likelihood
Yi ~ N 0 1X i , 2
1 Y X
2
1 i 0 1 i
fi e 2
2
L f1 f 2 f n (likelihood function)
Find 0 and 1 which maximizes L
Estimation of σ2
( Yi Ŷi ) e i
2
s
2
n2 n2
SSE
MSE
df E
s s Root MSE
2
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 15804 15804 904.12 <.0001
Error 11 192.28571 17.48052
Corrected Total 12 15997