It says in the user's manual : ties not only match nearest neighbor but also other controls with identical (tied) pscores.

With neighbor(1) , variables psmatch2 created in our original dataset show that each _id corresponds to a unique _n1.

So, what's the calculation process when there are several identical pscores to match and how it matches with all ties? Whether or not it takes the average of all tied observations, and whether or not "ties" just affects the ATE or ATT or AUE

As far as I know, there is not a command like "ties" in R package when doing PSM in R (maybe I am wrong) , so is the "tie" function specific to Stata?

enter image description here

Hello @Noah: I draw an example to suppose an output STATA dataset.

In the image,we can see the "_weight" of observation "b" is zero, because the frequency of "b" in the "_n1" column is zero.

However,"a" and "b" were equally distant from "A"(generate a tie);"a" and "b" were also equally distant from "B"(generate a tie again). That meant,"b" could actually be matched twice, but both were in a tie, and "b" was not chosen to be a "_n1" twice.

The same thing happened in the "_weight" of "A".("A" was matched three times but was only chosen and output in "_n1" once).

So, maybe the weight during calculation in ties is not showed in the output dataset?

  • $\begingroup$ Cross-posted at statalist.org/forums/forum/general-stata-discussion/general/… $\endgroup$
    – Nick Cox
    Commented Aug 25, 2021 at 17:13
  • 4
    $\begingroup$ psmatch2 is community-contributed. It's not documented in the User's Manual; the allusion is presumably to the help file. $\endgroup$
    – Nick Cox
    Commented Aug 25, 2021 at 17:15
  • $\begingroup$ Questions that are only about software (e.g. error messages, code or packages, etc.) are generally off topic here. If you have a substantive machine learning or statistical question, please edit to clarify. $\endgroup$ Commented Aug 30, 2021 at 4:02

1 Answer 1


The psmatch2 documentation is a bit vague. In the R package Matching, which implements similar estimators (more similar to teffects nnmatch actually), the ties options makes it so that if there are multiple control units with the same distance from a given treated unit, all of them are matched to that treated unit and given a weight of 1 divided by the number of matched controls. For example, if 2 control units were equally distant from a treated unit, they would both be matched to that created unit but each given a weight of 1/2. See the _weights output description. Ties affect estimation of any quantity.

If you notice no difference between setting the ties option and not setting it, there might not be any ties in your dataset. Ties are extremely rare when you have continuous covariates or many covariates.

  • $\begingroup$ So, in your example, although there are two control units matched, only 1 control will be chosen and output in our dataset "_n1",depending on our random seed sorting before the psmatch2? I think the "_weight”generated after psmatch2 in our dataset is also very confusing, they are ≥1. $\endgroup$
    – tumidou
    Commented Aug 25, 2021 at 17:40
  • $\begingroup$ And it seems that the value of “_weight” is the frequency of the id number in “_n1” column . $\endgroup$
    – tumidou
    Commented Aug 25, 2021 at 17:51
  • $\begingroup$ In my example, both would would be chosen and included if ties was specified, and only one would be chosen if ties was not specified. If you do matching with replacement or k:1 matching with a caliper or radius matching or kernel matching or many other types, _weights might be different from 1. $\endgroup$
    – Noah
    Commented Aug 25, 2021 at 19:15
  • $\begingroup$ Thanks! And I add an example image in the answer, may I trouble you to take a look? $\endgroup$
    – tumidou
    Commented Aug 26, 2021 at 7:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.