expand.formula           package:AlgDesign           R Documentation

_E_x_p_a_n_d_i_n_g _a _f_o_r_m_u_l_a

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

     Formulas are expanded to accommodate special functions for
     continuous and mixture variables.

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

     expand.formula(frml,varNames,const=TRUE,numerics=NULL)

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

    frml: A formula starting with ~ in the usual way.

varNames: A list of variable names to be used when a dot is used as
          shorthand for ``all variables.''

   const: If FALSE, the constant will be suppressed.

numerics: A vector the same length as varNames, with TRUE for
          corresponding numeric variables. If missing, all variables
          will be assumed to be numeric.

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

     This function expands formulas to accommodate polynomial models
     for which R has minimal support. Assuming for illustration that
     there are three variables, A, B, and C, the following expressions
     may be used. In addition, a dot may be used to indicate that all
     variables in varNames are to be used. 

     All agruments to quad(), cubic(), and cubicS() must be numeric.

        *  ~. makes ~ A + B + C

        *  ~.^p makes ~ (A + B + C)^p, where p is an integer

        *  quad(A,B,C) makes ~(A+B+C)^2+I(A^2)+I(B^2)+I(C^2)

        *  cubic(A,B,C) makes
           ~(A+B+C)^3+I(A^2)+I(B^2)+I(C^2)+I(A^3)+I(B^3)+I(C^3)

        *  cubicS(A,B,C) makes
           ~(A+B+C)^3+I(A*B*(A-B))+I(A*C*(A-C))+I(B*C*(B-C))

     The cubicS() function produces a non-singular representation of a
     cubic model, when the  variables are mixture variables, that is
     when the rows of 'data' sum to a constant value, usually 1.0.
     Because of the mixture constraint, models containing mixture
     variables should not have a constant term. The linear and
     quadratic models for mixture variables A, B, and C are given by
     -1+(A+B+C) and -1+(A+B+C)^2 respectively. See Gorman and Hinman
     [1962] for  details.

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

     An expanded formula is returned.

_N_o_t_e:

     expand.formula() is called by model.matrix() through the method
     call model.matix.formula(), thus one may use the above special
     functions with model.matrix().

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

     Bob Wheeler bwheeler@echip.com

     Please cite this program as follows:

     Wheeler, R.E. (2004). expand.formula. _AlgDesign_. The R project
     for statistical computing <URL: http://www.r-project.org/>

_R_e_f_e_r_e_n_c_e_s:

     Gorman, J.W. and Hinman, J.E. (1962). Simplex lattice designs for 
     multicomponent systems. _Technometrics_. 4-4. 463-487.

