ffFullMatrix              package:BHH2              R Documentation

_F_u_l_l _m_o_d_e_l _m_a_t_r_i_x _f_r_o_m _a _d_e_s_i_g_n _m_a_t_r_i_x

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

     The function builds the full matrix with the constant term, main
     effects and interactions from a design matrix.

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

         ffFullMatrix(X, x, maxInt, blk = NULL)

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

       X: numeric matrix. Design matrix.

       x: numeric vector. Design matrix entries to use to construct the
          full model matrix.

  maxInt: numeric. Highest interaction order.

     blk: numeric matrix. Each column correspond to a blocking factor.

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

     Columns 'x' of matrix 'X' are used for main effects. All the 2,
     ... , 'maxInt' order interaction are constructed. The first
     columns of the final matrix correspond to the constant term (1's)
     and block factors.

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

     The function returns list with the following components: 

      Xa: matrix

       x: numeric vector. Design matrix 'X' factor (column) numbers
          used to build the complete model matrix.

  maxInt: numeric. The highest interaction order.

  nTerms: numeric vector. Contains the number of blocking factors, main
          effects, 2nd order interaction effects, ... , etc.

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

     Ernesto Barrios

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

     'ffDesMatrix'

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

     print(X <- ffDesMatrix(5,gen=list(c(5,1,2,3,4))))
     ffFullMatrix(X[,1:4],x=c(1,2,3,4),maxInt=2,blk=X[,5])
     ffFullMatrix(X[,1:5],x=c(1,3,5),maxInt=3)

