matchdef               package:MatchIt               R Documentation

_N_e_a_r_e_s_t _n_e_i_g_h_b_o_r _m_a_t_c_h_i_n_g _a_l_g_o_r_i_t_h_m

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

     This is a sub-function of 'matchit' which performs the nearest
     neighbor matching; 'matchdef' is called automatically by
     'matchit'.

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

     matchdef <- matchdef(formula, in.sample, pscore, nearest=TRUE, replace=FALSE, 
                     m.order=2, ratio=1, caliper=0, calclosest=FALSE, mahvars=NULL, exact=FALSE, 
                     data=NULL, counter=TRUE)

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

 formula: (required).  Takes the form of 'T ~ X1 + X2', where 'T' is a
          binary treatment indicator and 'X1' and 'X2' are the
          pre-treatment covariates, and 'T', 'X1', and 'X2' are
          contained in the same data frame.  The '+' symbol means
          "inclusion" not "addition." You may also include interaction
          terms in the form if 'I(X1*X2)' or squared terms in the form
          of 'I(X1^2)'.

    data: Data frame containing the variables in 'formula'.

in.sample: Vector of length n showing whether each unit was eligible
          for matching due to common support restrictions with
          'discard'. Computed in 'distance'.

  pscore: Vector of propensity scores, calculated in 'distance'.

 nearest: Whether to perform nearest-neighbor matching (default=TRUE).  

 replace: Whether to match with replacement (default=FALSE). 

 m.order: Order in which to match treated units with control units. 
          1=optimal (requires ``optmatch" package),  2 (default)=from
          high to low, 3=from low to high, 4=random order.

   ratio: The number of control units to be matched to each treated
          unit (default=1).

 caliper: Standard deviations of the propensity score within which to
          draw control units (default=0).

calclosest: If 'caliper!=0', whether to take the nearest available
          match if no matches are available within 'caliper'
          (default=FALSE).

 mahvars: Variables on which to perform Mahalanobis matching within
          each caliper (default=NULL).  Should be entered as a vector
          of names of variables in 'data'.

   exact: "FALSE" (default)=no exact matching.  "TRUE"=exact matching
          on all variables in 'formula'.  A vector of variable names
          (that are in 'data') to indicate separate variables on which
          to exact match, in combination with matching on the
          propensity score.

 counter: Whether to display counter indicating the progress of the
          matching (default=TRUE).

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

     The matching is done using nearest neighbor matching on the
     propensity score, estimated in the sub-function \ref{distance}. 
     This function is called directly by 'matchit' and does not
     generally need to be called directly by users; these details are
     included for advanced users.

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

match.matrix: n1 by ratio data frame where the rows correspond to
          treated units and the columns store the names of the control
          units matched to each treated unit.  NA indicates that
          treated unit was not matched.

in.sample: Vector of length n showing whether each unit was eligible
          for matching due to common support restrictions with
          'discard'.

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

     Daniel Ho <deho@fas.harvard.edu>;  Kosuke Imai
     <kimai@princeton.edu>; Gary King <king@harvard.edu>; Elizabeth
     Stuart<stuart@stat.harvard.edu>

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

     Please use 'help.matchit' to access the matchit reference manual. 
     The complete document is available online at <URL:
     http://gking.harvard.edu/matchit>.

