contrastTest           package:factDesign           R Documentation

'_c_o_n_t_r_a_s_t_T_e_s_t' _p_e_r_f_o_r_m_s _s_i_m_u_l_t_a_n_e_o_u_s _t_e_s_t_s _o_f _l_i_n_e_a_r _c_o_n_t_r_a_s_t_s _o_n _t_h_e _p_a_r_a_m_e_t_e_r_s _e_s_t_i_m_a_t_e_s _f_r_o_m _a _l_i_n_e_a_r _m_o_d_e_l.

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

     'contrastTest' performs an F test for simultaneous tests of linear
     contrasts using an appropriately specified lambda matrix and an lm
     object.

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

     contrastTest(model, lambda, cVec = NA, p = 0.01)

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

   model: An lm object. 

  lambda: A matrix of coefficients in the appropriate order to be
          multiplied by the estromated coefficients of the lm object. 

    cVec: A vector of constants for testing that the linear contrasts
          equal something other than zero.  If this is unspecified, it
          is assumed to be zero. 

       p: The significance level at which to perform the contrast test. 

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

   test : Returns "REJECT" or "FAIL TO REJECT" based on the result of
          the test of hypothesis.

  pvalue: The pvalue from the F test.

    cEst: The contrast estimate.

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

     Denise Scholtens

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

     'par2lambda','lm'

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

     data(estrogen)
     ES <- pData(estrogen)[["ES"]]
     TIME <- pData(estrogen)[["TIME"]]   
     fit <- lm(exprs(estrogen)[6,] ~ ES + TIME + ES*TIME)
     betaNames <- names(fit[["coef"]])
     betas <- list(c("TIME48h","ESP:TIME48h"))
     coefs <- list(c(1,1))
     lambda <- par2lambda(betaNames,betas,coefs)
     contrastTest(fit,lambda)

