12.07.2015 Views

Flexible modelling using basis expansions (Chapter 5) Linear ...

Flexible modelling using basis expansions (Chapter 5) Linear ...

Flexible modelling using basis expansions (Chapter 5) Linear ...

SHOW MORE
SHOW LESS

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.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!