boolprep               package:boolean               R Documentation

_G_e_n_e_r_a_t_e _F_u_n_c_t_i_o_n_a_l _F_o_r_m _f_o_r _B_o_o_l_e_a_n _b_i_n_a_r_y _c_h_o_i_c_e _m_o_d_e_l

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

     Takes as arguments the logical form of a Boolean model, the
     dependent variable, and sets of independent variables, and
     produces a functional form necessary for inclusion in a 'boolean'
     command.

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

     boolprep(FORM, DEPVAR, ...)

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

    FORM: Form of Boolean model, e.g., '"a&b"',  '"a&(b|c)"', etc.
          Unlike previous versions of this package, you are not
          restricted to single letters. For example, '"(lucky|good)"'
          is now allowed as well. However, 'FORM' must be a character
          string. 

  DEPVAR: Dependent variable, which must be a logical vector or a
          numeric vector with zeroes and ones only, or the name of such
          a dependent variable can be given as a  character string. 

     ...: If there are n logical operators in FORM, users are required
          to pass n+1 arguments through the dots. These n+1 arguments
          should be one-sided formulas and follow the same  syntax as
          in the glm() function (see 'formula'),  such as '~ x1 + x2'.
          Note that if 'FORM = "(lucky|good)"',  then the required
          arguments would take a form such as  'lucky = ~x1, good =
          ~x2'. 

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

     Because the structure of a Boolean binary choice model can be
     arbitrarily complex, the layering of parentheses soon becomes
     tedious and unnecessarily difficult.  To make life easier, the
     'boolprep' command automates the task of creating the appropriate
     argument and checks for syntactical errors.

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

     An object of class boolprep with the structure of the model and
     the  appropriate formulas as list elements, none of which are
     expected to be  accessed by the user. However, 'boolean' requires
     that a  boolprep object be passed to it.

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

     Bear F. Braumoeller, Harvard University, bfbraum@fas.harvard.edu
      Ben Goodrich, Harvard University, goodrich@fas.harvard.edu, and
      Jacob Kline, Harvard University, jkline@fas.harvard.edu

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

     Braumoeller, Bear F. (2003) "Causal Complexity and the Study of
     Politics." _Political Analysis_ 11(3): 209-233.

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

     'boolean'

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

     y  <- rbinom(1000, 1, 0.5)

     bp <- boolprep("a & b", "y", a = ~x1+x2, b = ~x3+x4+x5)

     bp <- boolprep("rich | (smart & diligent)", y, rich = ~ x1+x2+x3, 
                    smart = ~ x4+x5, diligent = ~ x6)

     bp <- boolprep("(a|b|c)&(d|e)&f", y, a=~x1+x2, b = ~x3+x4+x5, 
                    c = ~x6, d = ~x7+x8, e = ~x9+x10+x11, f = ~x12+x13)

