我在alr3软件包中使用Length and Age形式的wblake数据在R中运行注册。如何知道长度取决于年龄或年龄的某种力量。
我已经使用Age进行多项式回归。
我的R代码如下:
require(alr3)
require(MASS)
require(lmreg)
data("wblake")
attach(wblake)
mod<-lm(Length~Age)
summary(mod)
mod2 <- lm(Length~poly(Age,3,raw=T)); summary(mod2)
and the output is :
Call:
lm(formula = Length ~ poly(Age, 3, raw = T))
Residuals:
Min 1Q Median 3Q Max
-81.521 -20.066 -3.612 17.066 93.412
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 82.4856 11.3401 7.274 1.64e-12 ***
poly(Age, 3, raw = T)1 10.4322 10.0722 1.036 0.3009
poly(Age, 3, raw = T)2 6.1282 2.6239 2.336 0.0200 *
poly(Age, 3, raw = T)3 -0.5314 0.2075 -2.560 0.0108 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 28.45 on 435 degrees of freedom
Multiple R-squared: 0.8198, Adjusted R-squared: 0.8185
F-statistic: 659.6 on 3 and 435 DF, p-value: < 2.2e-16`Call:
lm(formula = Length ~ poly(Age, 3, raw = T))