

contrasts {base}                             R Documentation

_G_e_t _a_n_d _S_e_t _C_o_n_t_r_a_s_t _M_a_t_r_i_c_e_s

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

     contrasts(x)
     contrasts(x) <- ctr

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

       x: a factor.

     ctr: either a matrix whose columns give coefficients
          for contrasts in the levels of `x', or the
          (quoted) name of a function which computes such
          matrices.

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

     These functions are used to set and view the contrasts
     associated with a factor.  If contrasts are not set for
     a factor the default functions from `options("con-
     trasts")' are used.

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

     `C', `contr.helmert', `contr.poly', `contr.sum',
     `contr.treatment', `glm', `aov', `lm'.

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

     example(factor)
     (fff <- factor(ff))
     contrasts(fff) # treatment
     contrasts(C(fff, sum))

