Skip to content
Prev 164725 / 398506 Next

Some clarificatins of anova() and summary ()

Why do you think that running lm() twice on those two models is going
to help me?  They are identical models and hence we get identical
results.The second question is now alright. I had some
misunderstanding about it.

Please tell me if you can find any "downside " in summary (). I can't find any.


i 've edited the code for that replication  issue.

set.seed(127)
n <- 50
x1 <- runif(n,1,10)
x2 <- x1 + rnorm(n,0,0.5)
plot(x1,x2) # x1 and x2 strongly correlated
cor(x1,x2)
y <- 3 + 0.5*x1 + 1.1*x2 + rnorm(n,0,2)
intact.lm <- lm(y ~ x1 + x2)
summary(intact.lm)
anova(intact.lm)
Call:
lm(formula = y ~ x1 + x2)

Residuals:
   Min      1Q  Median      3Q     Max
-3.4578 -1.1326  0.4551  1.2807  4.8241

Coefficients:
           Estimate Std. Error t value Pr(>|t|)
(Intercept)  3.63603    0.61944   5.870 4.23e-07 ***
x1          -0.09555    0.49114  -0.195  0.84658
x2           1.59384    0.48542   3.283  0.00194 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.807 on 47 degrees of freedom
Multiple R-squared: 0.8198,     Adjusted R-squared: 0.8121
F-statistic: 106.9 on 2 and 47 DF,  p-value: < 2.2e-16
Analysis of Variance Table

Response: y
         Df Sum Sq Mean Sq F value    Pr(>F)
x1         1 663.18  663.18 203.065 < 2.2e-16 ***
x2         1  35.21   35.21  10.781  0.001940 **
Residuals 47 153.49    3.27
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
On Sun, Dec 14, 2008 at 8:26 PM, David Winsemius <dwinsemius at comcast.net> wrote: