title: R: Propensity Score Matching. Does matchit function work with categorical matching variables?
body: <p>I am working with the matchIt packages and Propensity Score Matching in R. I saw some examples. But I could not find some example working with matching variables being factor ou character. For examples, age groups.</p>
  
  <pre><code>head(mydata)
      People region sex age_group treatment
      1      1      1   3         0
      2      1      2   5         0
      3      2      2   2         1
      4      2      2   3         0
      5      3      1   3         1
      6      3      1   6         1
  </code></pre>
  
  <p>Where the first four variables are from factor or character types. Also, the levels sex are Men = 1 and Famale = 2. </p>
  
  <p>The following line works with numeric matching variables( tot, mim and dis)- stw is the treatment variable-</p>
  
  <pre><code>m.out = matchit(stw ~ tot + min + dis,
  data = mydata, method = "nearest",
  ratio = 1) 
  </code></pre>
  
  <p>source: <a href="http://pareonline.net/getvn.asp?v=19&amp;n=18" rel="nofollow">http://pareonline.net/getvn.asp?v=19&amp;n=18</a></p>
  
  <p>I would like to know if matchit function works with categorical matching variables. If not, is there some appropriate package?</p>