factor.scope              package:base              R Documentation

_C_o_m_p_u_t_e _A_l_l_o_w_e_d _C_h_a_n_g_e_s _i_n _A_d_d_i_n_g _t_o _o_r _D_r_o_p_p_i_n_g _f_r_o_m _a _F_o_r_m_u_l_a

_D_e_s_c_r_i_p_t_i_o_n:

     `add.scope' and `drop.scope' compute those terms that can be
     individually added to or dropped from a model while respecting the
     hierarchy of terms.

_U_s_a_g_e:

     add.scope(terms1, terms2)
     drop.scope(terms1, terms2)
     factor.scope(factor, scope)

_A_r_g_u_m_e_n_t_s:

  terms1: the terms or formula for the base model.

  terms2: the terms or formula for the upper (`add.scope') or lower
          (`drop.scope') scope. If missing for `drop.scope' it is taken
          to be the null formula, so all terms (except any intercept)
          are candidates to be dropped.

  factor: the `"factor"' attribute of the terms of the base object.

   scope: a list with one or both components `drop' and `add' giving
          the `"factor"' attribute of the lower and upper scopes
          respectively.

_D_e_t_a_i_l_s:

     `factor.scope' is not intended to be called directly by users.

_V_a_l_u_e:

     For `add.scope' and `drop.scope' a character vector of terms
     labels. For `factor.scope', a list with components `drop' and
     `add', character vectors of terms labels.

_A_u_t_h_o_r(_s):

     B.D. Ripley

_S_e_e _A_l_s_o:

     `add1', `drop1', `aov', `lm'

_E_x_a_m_p_l_e_s:

     add.scope( ~ a + b + c + a:b,  ~ (a + b + c)^3)
     # [1] "a:c" "b:c"
     drop.scope( ~ a + b + c + a:b)
     # [1] "c"   "a:b"

