> x = 1:10
> y = 2:11
> a = lm(y ~ x, data = data.frame(y = y, x = x))
> mode(a)
[1] "list"
> names(a)
[1] "coefficients" "residuals" "effects" "rank"
[5] "fitted.values" "assign" "qr" "df.residual"
[9] "xlevels" "call" "terms" "model"
> a
Call:
lm(formula = y ~ x, data = data.frame(y = y, x = x))
Coefficients:
(Intercept) x
1 1
> summary(a)
Call:
lm(formula = y ~ x, data = data.frame(y = y, x = x))
Residuals:
Min 1Q Median 3Q Max
-5.661e-16 -1.157e-16 4.273e-17 2.153e-16 4.167e-16
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.000e+00 2.458e-16 4.069e+15 <2e-16 ***
x 1.000e+00 3.961e-17 2.525e+16 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.598e-16 on 8 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 6.374e+32 on 1 and 8 DF, p-value: < 2.2e-16
> b = summary(a)
> mode(b)
[1] "list"
> names(b)
[1] "call" "terms" "residuals" "coefficients"
[5] "aliased" "sigma" "df" "r.squared"
[9] "adj.r.squared" "fstatistic" "cov.unscaled"
> b[["coefficients"]]
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1 2.457583e-16 4.069038e+15 1.490336e-122
x 1 3.960754e-17 2.524772e+16 6.783304e-129
> mode(b[["coefficients"]])
[1] "numeric"
> class(b[["coefficients"]])
[1] "matrix"
> b[["coefficients"]][2,2]
[1] 3.960754e-17
|