解释r的多预测多项式回归输出



我需要从R导出最终的多元多项式回归方程到另一个应用程序。我不理解回归输出的一部分。回归使用polym()函数。汇总表如下:

ploy_lm <- lm(df$SV ~ polym(df$Indy, df$HI, degree = 3, raw = TRUE)
summary(ploy_lm)

下表显示了polym输入"df$Indy, df$HI, degree = 3, raw = TRUE"

拦截-8.903(1。o1.189 e0(石油输入)2。o-1.651依照(1.18.247的军医

下面是一个预定义函数的简单示例:

x1<-  runif(20, 1, 20)
x2 <- runif(20, 15, 30)
#define a function for y
y <- (1 - 3*x1 + 1/5*x2 - x1*x2 + 0.013*x1^2 + 0.2 *x2^2)
#add some noise to prevent a warning on the fit
y <- y +rnorm(20, 0, 0.01)
ploy_lm <- lm(y ~ polym(x1, x2, degree = 2, raw = TRUE))
summary(ploy_lm)

Call:
lm(formula = y ~ polym(x1, x2, degree = 2, raw = TRUE))
Residuals:
Min        1Q    Median        3Q       Max 
-0.017981 -0.007537  0.001757  0.005833  0.018697 
Coefficients:
Estimate Std. Error  t value Pr(>|t|)    
(Intercept)                               9.588e-01  7.158e-02    13.39 2.25e-09 ***
polym(x1, x2, degree = 2, raw = TRUE)1.0 -3.003e+00  2.820e-03 -1064.88  < 2e-16 ***
polym(x1, x2, degree = 2, raw = TRUE)2.0  1.315e-02  9.659e-05   136.15  < 2e-16 ***
polym(x1, x2, degree = 2, raw = TRUE)0.1  2.059e-01  6.536e-03    31.51 2.12e-14 ***
polym(x1, x2, degree = 2, raw = TRUE)1.1 -1.000e+00  1.059e-04 -9446.87  < 2e-16 ***
polym(x1, x2, degree = 2, raw = TRUE)0.2  1.998e-01  1.511e-04  1322.68  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.01167 on 14 degrees of freedom
Multiple R-squared:      1, Adjusted R-squared:      1 
F-statistic: 6.298e+08 on 5 and 14 DF,  p-value: < 2.2e-16            
#In summary
# Term         model    Fitted
# Intercept     1        .959
# x1           -3       -3
# x1^2          0.013    .0132
# x2            0.2     .206
# x2^2          0.2     .1998
# x1 * x2      -1       -1

")"之后的第一个数字是第一项的幂和"。"后面的数是第二项的幂

最新更新