Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: mata function for "lookup" or find rank if observation not in the ranked sample

From   László Sándor <>
Subject   st: mata function for "lookup" or find rank if observation not in the ranked sample
Date   Mon, 14 May 2012 11:04:50 -0400

I have another puzzle in Mata for Stata 10 and above. My previous
thread on this list help me match, say, treated observations to
treated observations, as I look up observations with propensity score
close to the observation's in a (selected) vector that the observation
itself is part of. The use of permutation vectors can be a dramatic
improvement compared to many-many runs of -mindex- on the full
propensity score vector.

However, just as important would be to find observations with similar
propensity scores in the subsample with opposite treatment. The
observation itself is not part of that subsample, so I cannot simply
look up its own rank there in a permutation vector I generate only
once before I loop through all observations. Somehow I would need to
know the rank of, say, a treated observation in the subsample of the
control group. Actually, to really spare me costly runs on the entire
control-prop.score-vector for each (treated) iteration, this lookup
would better use some information I can generate for the whole
population and the ranks there and/or in the two subsamples.

Please let me know if you have thoughts about this.


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index