Diagnostics & Remedial Measures
Download
Report
Transcript Diagnostics & Remedial Measures
선형통계모형
아주대학교 산업공학과 대학원
Diagnostics & Remedial Measures
Scatter Plot Matrix
Diagnostics & Remedial Measures
Correlation Matrix
넓적다리
삼두박근 넓적다리
0.924
0.000
상완
0.458
0.042
0.085
0.723
체지방
0.843
0.000
0.878
0.000
셀 내용: Pearson 상관 계수
상완
0.142
0.549
Diagnostics & Remedial Measures
Three Dimensional Scatter Plot
Diagnostics & Remedial Measures
Residual Plot
Normality Test for Residuals
Constancy of Error Variance
Lack of Fit test
H 0 : E (Y ) 0 1 X 1 p 1 X p 1
Extra Sum of Squares
Multiple Regression 에서 적합함 모델 수립
적은 수의 독립변수로 이루어진 모델
Extra Sum of Squares
SSR( X 2 | X 1 ) SSR( X 1 , X 2 ) SSR( X 2 )
SSE ( X 1 ) SSE ( X 1 , X 2 )
SSR( X 3 | X 1 , X 2 ) SSE ( X 1 , X 2 ) SSE ( X 1 , X 2 , X 3 )
SSTO
SSR(X2)
SSE(X2)
SSR(X1|X2) SSE(X1,X2)
Extra Sum of Squares
Decomposition of SSR
SSTO SSR( X1 ) SSE( X1 )
SSTO SSR( X1 ) SSR( X 2 | X1 ) SSE( X1, X 2 )
SSR( X1, X 2 ) SSR( X1 ) SSR( X 2 | X1 )
Extra Sum of Squares
Tests for Regression Coefficients
H0 : k 0
1.
2.
t-test
t0
bk
s{bk }
F-test
예) Y 0 1 X 1 2 X 2 3 X 3
H 0 : 3 0
Full Model 의 SSE
SSE ( F ) SSE ( X 1 , X 2 , X 3 )
Reduced Model 의 SSE
검정통계량
F0
SSE( R) SSE( X1 , X 2 )
MSR ( X 3 | X 1 , X 2 )
( SSE ( R ) SSE ( F )) /( df R df F )
SSE ( F ) / df F
MSE ( X 1 , X 2 , X 3 )
Extra Sum of Squares
Tests for Regression Coefficients
H 0 : 2 3 0
Standard Error : 계수의 표준편차
Full Model 의 SSE
SSE ( F ) SSE ( X 1 , X 2 , X 3 )
Reduced Model 의 SSE
SSE( R) SSE( X1 )
검정통계량
F0
SSR ( X 2 , X 3 | X 1 ) / 2
( SSE ( R ) SSE ( F )) /( df R df F )
SSE ( F ) / df F
SSE ( X 1 , X 2 , X 3 ) /( n 4)
MSR ( X 2 , X 3 | X 1 )
MSE ( X 1 , X 2 , X 3 )
T=5.375/0.6638
예측 변수 계수 SE 계수
T
P
상수
0.375 4.740 0.08 0.940
crew
5.3750 0.6638 8.10 0.000
bonus
9.250 1.328 6.97 0.001
Coefficient of Partial Determination
Coefficient of partial determination of Y and X1 when X2 is
already in the model
RY21|2
SSE ( X 2 ) SSE ( X 1 , X 2 )
SSR ( X 1 | X 2 )
SSE ( X 2 )
SSE ( X 2 )
cf. conditional probability
P{B | A}
n( A B )
n( A)
SSTO
SSR(X2)
SSE(X2)
SSR(X1|X2) SSE(X1,X2)
Standardized Regression
Non-standardized model 의 경우
1) round-off error
2) Lack of comparability of regression coefficients
Standardization
Yi Y
sY
X ik X k
sk
Correlation Transformation
Yi
*
Yi Y
1
n 1 sY
*
X ik
X ik X k
1
sk
n 1
Correlation Transformation
Model
Yi* 1* X i*1 p*1 X i*, p 1 i*
k
sY
k*
sk
0 Y 1 X1 p 1 X p 1
• properties
(X
X i1 X 1 2
(
X
)
(
s n 1 )
1
*
i1
X
*
i1
2
X
*
i2
XT X rXX
(X
( X
i1
i1
i1
X1 )2 / n 1
s12
X 1 )( X i 2 X 2 )
X1 )
2
XT Y rXY
(X
i2
X2)
2 1/ 2
1
r12
Correlation Transformation
Normal Equations
rXX b* rXY
1
b* rXX
rXY
rXX :x들의 상관계수매트릭스
standardized regression coefficients
Multicollinearity
Uncorrelated predictor variables case : 생산성 문제에서
SSR( X1 )
SSR( X1 | X 2 )
SSR( X 2 )
SSR( X 2 | X1 )
Body Fat 문제
Polynomial Regression
Polynomial regression 은 multiple linear regression 의 특수한 case
로 간주할 수 있다. 그러나 4 차식 이상에서는 multicollinearity 발생 가
능성아 높다. orthogonal polynomial
2 predictor variables-second order
E (Y ) 0 1 X 1 2 X 2 11 X 12 22 X 22 12 X 1 X 2
Interaction Effect(교작용)
예)
E(Y ) 10 2 X1 5 X 2 0.5 X1 X 2
X2 = 3 인 경우
X2 = 1 인 경우
E(Y) = 25 + 3.5X1
E(Y) = 15 + 2.5X1
Qualitative Predictors
사례 : study of innovation in the insurance industry
Y : innovation period
X1 : size of firm
X2 : type of firm
= 1 for stock company
= 0 for mutual company
Y 0 1 X 1 2 X 2
model :
Y
2
Q) 각 기업형태별로
각각 regression 하는
것보다 유리한 점은?
E (Y ) ( 0 2 ) 1 X 1
Stock company
E (Y ) 0 1 X 1
동일한 에러일 경우 가능하면 각각 하는 것보다
합쳐서 하면 DF(자유도)가 낮아져서 에러율이 적다
mutual company
X1
Qualitative Predictors
사례 : study of innovation in the insurance industry
Y 0 1 X 1 2 X 2 3 X 1 X 2
model :
Y
2
E (Y ) ( 0 2 ) ( 1 3 ) X 1
Stock company
E (Y ) 0 1 X 1
mutual company
X1
Qualitative Predictors
More than 2 classes
사례) tool wear 를 tool speed 와 tool type 에 따라 회귀분석
만일 tool type 이 (M1,M2, M3, M4) 로 4가지 type 이 있다면
Y : tool wear
X1 : tool speed
X2 = 1 if M1
0 o/w
X3 = 1 if M2
0 o/w
X4 = 1 if M3
0 o/w
Y 0 1 X 1 2 X 2 3 X 3 4 X 4
Qualitative Predictors
앞의 경우를
Y : tool wear
X1 : tool speed
X2 = 0 if M1
1 if M2
2 if M3
3 if M4
로 하여 모델을
Y 0 1 X 1 2 X 2
로 하는 것은 곤란함. 왜냐하면 이 경우
E(Y | X 2 1) E(Y | X 2 0) E(Y | X 2 2) E(Y | X 2 1) E(Y | X 2 3) E(Y | X 2 2) 2
Comparison of Two or More
Regression Functions
사례 : 비누생산라인 (p 330)
산점도: ‘회귀선및그룹표시’에서
X=scrap ,Y=line speed이고
범주형에 line을 선택한다
회귀분석에서 저장에 가서 ‘잔차’를 선택한다.
Comparison of Two or More
Regression Functions
Regression model
Y : amount of scrap
X1 : line speed
X2 = 1 if line 1
0 if line 2
계산기에 가서 저장할 장소를 지정하고,
식을 'line speed'*'line‘이렇게 작성하고 확인
Y 0 1 X 1 2 X 2 3 X 1 X 2
Ho : b2=b3=0
H1:not H0
회귀분석에서 새로 생긴 변수를 포함하여 변수를
지정하고 저장의 잔차를 체크 해제
예측 변수
계수 SE 계수
T
P
상수
7.57 20.87 0.36 0.720
line speed 1.32205 0.09262 14.27 0.000
line
90.39 28.35 3.19 0.004
X1X2
-0.1767 0.1288 -1.37 0.184
S = 20.7512
R-제곱 = 94.5%
R-제곱(수정) = 93.7%
분산 분석
출처
DF
SS
MS
F
P
회귀
3 169165 56388 130.95 0.000
잔차 오차 23 9904 431
전체
26 179069
출처
DF Seq SS
line speed 1 149661
line
1 18694
X1X2
1
810
Comparison of Two or More
Regression Functions
회귀 방정식은
scrap = 7.6 + 1.32 line speed + 90.4 line - 0.177 X1X2
기초회계-이표본분산-RESI1(표본),LINE(첨자)으로 그리면
아래와 같다
예측 변수
계수 SE 계수
T
P
상수
7.57 20.87 0.36 0.720
line speed 1.32205 0.09262 14.27 0.000
line
90.39 28.35 3.19 0.004
X1X2
-0.1767 0.1288 -1.37 0.184
S = 20.7512
R-제곱 = 94.5%
분산 분석
R-제곱(수정) = 93.7%
계산기에 가서 저장할 장소를 지정하고,
식을 'line speed'*'line‘이렇게 작성하고 확인
출처
DF
SS
MS
F
P
회귀
3 169165 56388 130.95 0.000
잔차 오차 23 9904 431
전체
26 179069
출처
DF Seq SS
line speed 1 149661
line
1 18694
X1X2
1
810
Comparison of Two or More
Regression Functions
1. Test for Variance Equity : see text p332
2. Test for identity of regression functions
H 0 : 2 3 0
3. Test for same slopes
H 0 : 3 0
F분포 : 계산-확률분포에 있음
누적분포함수
F 분포(2 분자 DF, 23 분모 DF)
x P( X <= x )
0.95
0.598600