

dropterm(MASS)                               R Documentation

_T_r_y _A_l_l _O_n_e_-_T_e_r_m _D_e_l_e_t_i_o_n_s _f_r_o_m _a _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n_:

     Try fitting all models that differ from the current
     model by dropping a single term, maintaining marginal-
     ity.

     This function is generic; there exist methods for
     classes `lm' and `glm' and the default method will work
     for many other classes.

_U_s_a_g_e_:

     dropterm(object, scope, , scale = 0, test=c("none", "Chisq", "F"),
              k = 2, sorted = FALSE, trace = FALSE, ...)

_A_r_g_u_m_e_n_t_s_:

  object: A object fitted by some model-fitting function.

   scope: a formula giving terms which might be dropped. By
          default, the model formula. Only terms that can be
          dropped and maintain marginality are actually
          tried.

   scale: used in the definition of the AIC statistic for
          selecting the models, currently only for `lm',
          `aov' and `glm' models. Specifying `scale' asserts
          that the residual standard error or dispersion is
          known.

    test: should the results include a test statistic rela-
          tive to the original model?  The F test is only
          appropriate for `lm' and `aov' models. The Chisq
          test can be an exact test (`lm' models with known
          scale) or a likelihood-ratio test depending on the
          method.

       k: the multiple of the number of degrees of freedom
          used for the penalty.  Only `k=2' gives the gen-
          uine AIC: `k = log(n)' is sometimes referred to as
          BIC or SBC.

  sorted: should the results be sorted on the value of AIC?

   trace: if `TRUE' additional information may be given on
          the fits as they are tried.

_D_e_t_a_i_l_s_:

     The definition of AIC is only up to an additive con-
     stant: when appropriate (`lm' models with specified
     scale) the constant is taken to be that used in Mal-
     lows' Cp statistic and the results are labelled accord-
     ingly.

_V_a_l_u_e_:

     A table of class `"anova"' containing at least columns
     for the change in degrees of freedom and AIC (or Cp)
     for the models. Some methods will give further informa-
     tion, for example sums of squares, deviances, log-like-
     lihoods and test statistics.

_S_e_e _A_l_s_o_:

     `addterm', `stepAIC'

_E_x_a_m_p_l_e_s_:

     data(quine)
     quine.hi <- aov(log(Days + 2.5) ~ .^4, quine)
     quine.nxt <- update(quine.hi, . ~ . - Eth:Sex:Age:Lrn)
     dropterm(quine.nxt, test="F")
     quine.stp <- stepAIC(quine.nxt,
         scope = list(upper = ~Eth*Sex*Age*Lrn, lower = ~1),
         trace = FALSE)
     dropterm(quine.stp, test="F")
     quine.3 <- update(quine.stp, . ~ . - Eth:Age:Lrn)
     dropterm(quine.3, test="F")
     quine.4 <- update(quine.3, . ~ . - Eth:Age)
     dropterm(quine.4, test="F")
     quine.5 <- update(quine.4, . ~ . - Age:Lrn)
     dropterm(quine.5, test="F")

     data(housing)
     house.glm0 <- glm(Freq ~ Infl*Type*Cont + Sat, family=poisson,
                        data=housing)
     house.glm1 <- update(house.glm0, . ~ . + Sat*(Infl+Type+Cont))
     dropterm(house.glm1, test="Chisq")

