Flexible modelling using basis expansions (Chapter 5) Linear ...
Flexible modelling using basis expansions (Chapter 5) Linear ...
Flexible modelling using basis expansions (Chapter 5) Linear ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
The function stepAIC does all this for you:> ns.hr.step #> # Here we are at Table 5.1; note that alcohol has been dropped from the> # model2005-02-08Example: heart dataThe degrees of freedom fitted are the number of columns in the<strong>basis</strong> matrix (+ 1 for the intercept). This can also be computed as thetrace of the hat matrix, which can be extracted from lm. There issomething analogous for glm, because glm’s are fitted <strong>using</strong>iteratively reweighted least squares.