alias                  package:base                  R Documentation

_F_i_n_d _A_l_i_a_s_e_s (_D_e_p_e_n_d_e_n_c_i_e_s) _i_n _a _M_o_d_e_l

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

     Find aliases (linearly dependent terms) in a linear model
     specified by a formula.

_U_s_a_g_e:

     alias(object, ...)
     alias.formula(object, data, ...)
     alias.lm(object, complete = TRUE, partial = FALSE, partial.pattern = FALSE)

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

  object: A fitted model object, for example from `lm' or `aov', or a
          formula for `alias.formula'.

    data: Optionally, a data frame to search for the objects in the
          formula.

complete: Should information on complete aliasing be included?

 partial: Should information on partial aliasing be included?

partial.pattern: Should partial aliasing be presented in a schematic
          way? If this is done, the results are presented in a more
          compact way, usually giving the deciles of the coefficients.

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

     Although the main method is for class `"lm"', `alias' is most
     useful for experimental designs and so is used with fits from
     `aov'. Complete aliasing refers to effects in linear models that
     cannot be estimated independently of the terms which occur earlier
     in the model and so have their coefficients omitted from the fit.
     Partial aliasing refers to effects that can be estimated less
     precisely because of correlations induced by the design.

_V_a_l_u_e:

     A list (of `class "listof"') containing components 

   Model: Description of the model; usually the formula.

Complete: A matrix with columns corresponding to effects that are
          linearly dependent on the rows; may be of class `"mtable"'
          which has its own `print' method.

 Partial: The correlations of the estimable effects, with a zero
          diagonal.

_N_o_t_e:

     The aliasing pattern may depend on the contrasts in use: Helmert
     contrasts are probably most useful.

     The defaults are different from those in S.

_A_u_t_h_o_r(_s):

     B.D. Ripley

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

     ## From Venables and Ripley (1997) p.210.
     N <- c(0,1,0,1,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0)
     P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0)
     K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0)
     yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0,
                62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0)
     npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P),
                       K=factor(K), yield=yield)

     ## The next line is optional (for fractions package which gives neater
     ## results.)
     has.VR <- require(MASS, quietly = TRUE)

     op <- options(contrasts=c("contr.helmert", "contr.poly"))
     npk.aov <- aov(yield ~ block + N*P*K, npk)
     alias(npk.aov)
     if(has.VR) detach(package:MASS)
     options(op)# reset

