October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to fit a generalized additive model into data:
> install.packages("mgcv")
> library(mgcv)
> install.packages("MASS")
> library(MASS)
> attach(Boston)
> str(Boston)
> fit = gam(dis ~ s(nox))
> summary(fit) Output: Family: gaussian Link function: identity Formula: dis ~ s(nox) Parametric coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.79504 0.04507 84.21 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Approximate significance of smooth ...
Read now
Unlock full access