Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: psmatch2-identifying matched pairs

From   "Nick Cox" <>
To   <>
Subject   st: RE: psmatch2-identifying matched pairs
Date   Wed, 31 Mar 2010 14:13:08 +0100

I don't know anything about -psmatch2- (which is a user-written program
from SSC, as should be explained). But the problem may be soluble by
-egen, group()-. A more general discussion is given by 

SJ-7-4  dm0034  . . . Stata tip 52: Generating composite categorical
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q4/07   SJ 7(4):582--583                                 (no
        tip on how to generate categorical variables using
        tostring and egen, group()


Garth Rauscher

I apologize if this has been answered before but I could not find the
solution in the archives. When I perform 1-1 matching using psmatch2,
several new variables are added to my dataset. Among these are _id,
which is
a unique identifier for each observation, and _n1, which identifies the
for the observation in the matched pair. I'd like to be able to define a
variable that uniquely identifies each matched pair. In other words if
are 100 observations making 50 matched pairs, there are 100 unique
values of
_id and 100 unique values of _n1. I'd like a variable with 50 unique
one for each matched pair. Stata doesn't appear to create this variable.
Having this variable would enable me to conduct stratified analyses
(stratifying on matched pairs) outside of what is provided by psmatch2.
Given _id and _n1 there is probably a way to do this but it is beyond my
skill set.  I'd appreciate if there are any ideas out there as to how to
about defining this variable.

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index