makeContrasts             package:limma             R Documentation

_C_o_n_s_t_r_u_c_t _M_a_t_r_i_x _o_f _C_u_s_t_o_m _C_o_n_t_r_a_s_t_s

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

     Construct the contrast matrix corresponding to specified contrasts
     of a set of parameters.

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

     makeContrasts(..., contrasts=NULL, levels) 

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

     ...: expressions, or character strings which can be parsed to
          expressions, specifying contrasts

contrasts: character vector specifying contrasts

  levels: character vector or factor giving the names of the parameters
          of which contrasts are desired, or a design matrix or other
          object with the parameter names as column names.

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

     This function expresses contrasts between a set of parameters as a
     numeric matrix. The parameters are usually the coefficients from a
     linear model fit, so the matrix specifies which comparisons
     between the coefficients are to be extracted from the fit. The
     output from this function is usually used as input to
     'contrasts.fit'. The contrasts can be specified either as
     expressions using '...' or as a character vector through
     'contrasts'. (Trying to specify contrasts both ways will cause an
     error.)

     The parameter names must be syntactically valid variable names in
     R and so, for example, must begin with a letter rather than a
     numeral. See 'make.names' for a complete specification of what is
     a valid name.

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

     Matrix which columns corresponding to contrasts.

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

     Gordon Smyth

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

     An overview of linear model functions in limma is given by
     06.LinearModels.

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

     makeContrasts(B-A,C-B,C-A,levels=c("A","B","C"))
     makeContrasts(contrasts="A-(B+C)/2",levels=c("A","B","C"))
     x <- c("B-A","C-B","C-A")
     makeContrasts(contrasts=x,levels=c("A","B","C"))

