Page 407 - Applied Statistics with R
P. 407

16.2. SELECTION PROCEDURES                                        407




                                              AIC vs Model Complexity




                             282

                             280
                        AIC
                             278


                             276

                             274

                                 2      3      4       5      6      7       8      9

                                                 p, number of parameters



                      We could easily repeat this process for BIC.


                                                        RSS
                                           BIC =    log (  ) + log(  )  .
                                                           
                      hipcenter_mod_bic = n * log(all_hipcenter_mod$rss / n) + log(n) * (2:p)


                      which.min(hipcenter_mod_bic)



                      ## [1] 1

                      all_hipcenter_mod$which[1,]



                      ## (Intercept)          Age       Weight     HtShoes           Ht       Seated
                      ##         TRUE       FALSE        FALSE       FALSE         TRUE        FALSE
                      ##          Arm       Thigh          Leg
                      ##        FALSE       FALSE        FALSE

                      hipcenter_mod_best_bic = lm(hipcenter ~ Ht, data = seatpos)
   402   403   404   405   406   407   408   409   410   411   412