Page 356 - Applied Statistics with R
P. 356

356                              CHAPTER 14. TRANSFORMATIONS


                                 ## poly(x, degree = 4)1   -2.0539      2.7940  -0.735     0.463
                                 ## poly(x, degree = 4)2 -49.3448       2.7940 -17.661   < 2e-16 ***
                                 ## poly(x, degree = 4)3    0.6699      2.7940   0.240     0.811
                                 ## poly(x, degree = 4)4   20.5198      2.7940   7.344 3.06e-12 ***
                                 ## ---
                                 ## Signif. codes:   0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
                                 ##
                                 ## Residual standard error: 2.794 on 245 degrees of freedom
                                 ## Multiple R-squared:   0.5993, Adjusted R-squared:    0.5928
                                 ## F-statistic: 91.61 on 4 and 245 DF,    p-value: < 2.2e-16

                                 summary(fit_4c)



                                 ##
                                 ## Call:
                                 ## lm(formula = y ~ x + I(x^2) + I(x^3) + I(x^4), data = data_higher)
                                 ##
                                 ## Residuals:
                                 ##     Min       1Q  Median       3Q     Max
                                 ## -7.6982 -2.0334   0.0042  1.9532   7.4626
                                 ##
                                 ## Coefficients:
                                 ##              Estimate Std. Error t value Pr(>|t|)
                                 ## (Intercept)    2.9996     0.3315    9.048  < 2e-16 ***
                                 ## x             -0.3880     0.3828   -1.014    0.312
                                 ## I(x^2)        -6.1511     0.5049 -12.183   < 2e-16 ***
                                 ## I(x^3)         0.1269     0.1456    0.871    0.384
                                 ## I(x^4)         1.0282     0.1400    7.344 3.06e-12 ***
                                 ## ---
                                 ## Signif. codes:   0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
                                 ##
                                 ## Residual standard error: 2.794 on 245 degrees of freedom
                                 ## Multiple R-squared:   0.5993, Adjusted R-squared:    0.5928
                                 ## F-statistic: 91.61 on 4 and 245 DF,    p-value: < 2.2e-16


                                 14.2.6   Inhibit Function



                                 coef(lm(y ~ x + x ^ 2, data = quad_data))



                                 ## (Intercept)            x
                                 ##   -18.32715     24.87163
   351   352   353   354   355   356   357   358   359   360   361