> y <- rnorm(10)
> x <- rnorm(10)
> xy.lm <- lm(y ~ x)
> anova(xy.lm)
Analysis of Variance Table
Response: y
Terms added sequentially (first to last)
Df Sum of Sq Mean Sq F Value Pr(F)
x 1 0.32616 0.326158 0.2489053 0.6312743
Residuals 8 10.48297 1.310372
> summary(xy.lm)
Call: lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-2.269 -0.4222 0.03735 0.583 1.742
Coefficients:
Value Std. Error t value Pr(>|t|)
(Intercept) -0.4111 0.4207 -0.9772 0.3571
x 0.1841 0.3691 0.4989 0.6313
Residual standard error: 1.145 on 8 degrees of freedom
Multiple R-Squared: 0.03017
F-statistic: 0.2489 on 1 and 8 degrees of freedom, the p-value is 0.6313
Correlation of Coefficients:
(Intercept)
x -0.5096
> names(summary(xy.lm))
[1] "call" "terms" "residuals" "coefficients" "sigma"
[6] "df" "r.squared" "fstatistic" "cov.unscaled" "correlation"
> summary(xy.lm)$sigma
[1] 1.144715
> summary(xy.lm)$sigma^2
[1] 1.310372
>
|