User Tools

Site Tools


suppressor_in_multiple_regression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
suppressor_in_multiple_regression [2025/11/09 12:42] – [도식화] hkimscilsuppressor_in_multiple_regression [2025/11/11 01:09] (current) hkimscil
Line 477: Line 477:
 summary(lm.y.x2)$r.squared = 0 summary(lm.y.x2)$r.squared = 0
 lm.y.x1 <- lm(y ~ x1) lm.y.x1 <- lm(y ~ x1)
-summary(lm.y.x1)$r.squared = a+summary(lm.y.x1)$r.squared = a, p > .05 (may be not significant) 
 +# 그러나 아래처럼 x2가 포함됨으로써  
 +# x1 내의 x2와 관련된 부분이 제거되어  
 +# 분석됨으로 significant하게 됨
 lm.y.x1x2 <- lm(y ~ x1 +  x2) lm.y.x1x2 <- lm(y ~ x1 +  x2)
-summary(lm.y.x1)$r.squared = a # but, with x1 without overlapped area with x2 as explaining part +summary(lm.y.x1)$r.squared = a 
 </code> </code>
  
Line 504: Line 506:
 > lm.x1.x2 <- lm(Price~CompPrice, data = cs.dat) > lm.x1.x2 <- lm(Price~CompPrice, data = cs.dat)
 > res.x1x2 <- lm.x1.x2$residuals > res.x1x2 <- lm.x1.x2$residuals
-> lm.y.resx1x2 <- lm(Sales~res.x1x2)+> lm.y.onlyx1<- lm(Sales~res.x1x2)
 > summary(lm.y.onlyx1)$r.squared > summary(lm.y.onlyx1)$r.squared
 [1] 0.3537271 [1] 0.3537271
Line 517: Line 519:
 [1] 0.1979812 [1] 0.1979812
 > >
- +> summary(lm.y.x1)$r.squared 
 +[1] 0.1979812 
 +> pcor.test(Sales, Price, CompPrice) 
 +    estimate     p.value statistic   n gp  Method 
 +1 -0.5959744 9.95161e-40 -14.78787 400  1 pearson 
 +> pcor.test(Sales, Price, CompPrice)$estimate^2 
 +[1] 0.3551855 
 +> summary(lm.y.x2)$r.squared 
 +[1] 0.004106084 
 +
 </code> </code>
suppressor_in_multiple_regression.1762692155.txt.gz · Last modified: by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki