Quantcast

psmatch2-identifying matched pairs

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

psmatch2-identifying matched pairs

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 _id
for the observation in the matched pair. I’d like to be able to define a new
variable that uniquely identifies each matched pair. In other words if there
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 values,
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 go
about defining this variable.

Thanks very much

Garth

Garth Rauscher
Associate Professor of Epidemiology
Division of Epid/Bios (M/C 923)
UIC School of Public Health
1603 West Taylor Street
Chicago, IL 60612
ph: (312)413-4317
fx:  (312)996-0064
em: [hidden email]
 



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: psmatch2-identifying matched pairs

Nick Cox
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
variables
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q4/07   SJ 7(4):582--583                                 (no
commands)
        tip on how to generate categorical variables using
        tostring and egen, group()

Nick
[hidden email]

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
_id
for the observation in the matched pair. I'd like to be able to define a
new
variable that uniquely identifies each matched pair. In other words if
there
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
values,
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
go
about defining this variable.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nick Cox
Sent: Wednesday, March 31, 2010 8:13 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

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
variables
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q4/07   SJ 7(4):582--583                                 (no
commands)
        tip on how to generate categorical variables using
        tostring and egen, group()

Nick
[hidden email]

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
_id
for the observation in the matched pair. I'd like to be able to define a
new
variable that uniquely identifies each matched pair. In other words if
there
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
values,
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
go
about defining this variable.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
In reply to this post by Nick Cox
I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nick Cox
Sent: Wednesday, March 31, 2010 8:13 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

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
variables
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q4/07   SJ 7(4):582--583                                 (no
commands)
        tip on how to generate categorical variables using
        tostring and egen, group()

Nick
[hidden email]

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
_id
for the observation in the matched pair. I'd like to be able to define a
new
variable that uniquely identifies each matched pair. In other words if
there
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
values,
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
go
about defining this variable.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
In reply to this post by Nick Cox
I managed to figure out how to identify and subset my data to include only
the matched pairs created by psmatch2. What was (and still is) confusing me
was that if I included the ate option, some of the matched pairs were
"broken" and a member of the pair was no longer identified as such. I don't
understand why this happened, but, nonetheless for my purposes, leaving off
the ate option allowed the following code to work:

---------------------------------------------------------------------
psmatch2 path2, pscore(p_prodterms) outcome(binarystage) caliper(.001)
noreplace neighbor(1)

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
---------------------------------------------------------------------

This code creates the variable pair that identifies the matched pairs.


I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nick Cox
Sent: Wednesday, March 31, 2010 8:13 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

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
variables
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q4/07   SJ 7(4):582--583                                 (no
commands)
        tip on how to generate categorical variables using
        tostring and egen, group()

Nick
[hidden email]

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
_id
for the observation in the matched pair. I'd like to be able to define a
new
variable that uniquely identifies each matched pair. In other words if
there
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
values,
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
go
about defining this variable.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: psmatch2-identifying matched pairs

Ariel Linden, DrPH-2
In reply to this post by Garth Rauscher
Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

Date: Fri, 2 Apr 2010 13:57:53 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

I managed to figure out how to identify and subset my data to include only
the matched pairs created by psmatch2. What was (and still is) confusing me
was that if I included the ate option, some of the matched pairs were
"broken" and a member of the pair was no longer identified as such. I don't
understand why this happened, but, nonetheless for my purposes, leaving off
the ate option allowed the following code to work:

- ---------------------------------------------------------------------
psmatch2 path2, pscore(p_prodterms) outcome(binarystage) caliper(.001)
noreplace neighbor(1)

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
- ---------------------------------------------------------------------

This code creates the variable pair that identifies the matched pairs.


I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

- ------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: psmatch2-identifying matched pairs

Jeanne Sears
In reply to this post by Garth Rauscher
...
Since _weight holds the frequency a particular observation was used as a
match (and is missing if the observation was not a control or used as a
match), this may do the subsetting part of what you want:

drop if _weight==.

--
Jeanne Sears, PhD, MS, RN
Research Scientist
Department of Health Services &
Center for Healthcare Improvement for Addictions, Mental Illness
and Medically Vulnerable Populations (CHAMMP)
University of Washington
Box 354809
Seattle, WA  98195

e-mail: [hidden email]



Date: Sat, 3 Apr 2010 08:03:56 -0700
From: "Ariel Linden, DrPH" <[hidden email]>
Subject: st: RE: psmatch2-identifying matched pairs

Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

Date: Fri, 2 Apr 2010 13:57:53 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

I managed to figure out how to identify and subset my data to include only
the matched pairs created by psmatch2. What was (and still is) confusing me
was that if I included the ate option, some of the matched pairs were
"broken" and a member of the pair was no longer identified as such. I don't
understand why this happened, but, nonetheless for my purposes, leaving off
the ate option allowed the following code to work:

- - ---------------------------------------------------------------------
psmatch2 path2, pscore(p_prodterms) outcome(binarystage) caliper(.001)
noreplace neighbor(1)

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
- - ---------------------------------------------------------------------

This code creates the variable pair that identifies the matched pairs.


I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

- - ------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
In reply to this post by Ariel Linden, DrPH-2
Thanks to Ariel for the explanation. To estimate the average treatment
effect in the population (ATE) it makes sense that the 1:1 matching would
not be used. However, with the ATE option in PSMATCH2, the output also
includes estimates of ATT and ATU along with ATE, therefore it would seem
that the program would still need to know the matched pairs in order to
estimate ATT. Therefore I don't understand why the identified pairs change
and some appear to be "broken".

Garth Rauscher
Associate Professor of Epidemiology
Division of Epid/Bios (M/C 923)
UIC School of Public Health
1603 West Taylor Street
Chicago, IL 60612
ph: (312)413-4317
fx:  (312)996-0064
em: [hidden email]
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ariel Linden,
DrPH
Sent: Saturday, April 03, 2010 10:04 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

Date: Fri, 2 Apr 2010 13:57:53 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

I managed to figure out how to identify and subset my data to include only
the matched pairs created by psmatch2. What was (and still is) confusing me
was that if I included the ate option, some of the matched pairs were
"broken" and a member of the pair was no longer identified as such. I don't
understand why this happened, but, nonetheless for my purposes, leaving off
the ate option allowed the following code to work:

- ---------------------------------------------------------------------
psmatch2 path2, pscore(p_prodterms) outcome(binarystage) caliper(.001)
noreplace neighbor(1)

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
- ---------------------------------------------------------------------

This code creates the variable pair that identifies the matched pairs.


I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

- ------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
In reply to this post by Jeanne Sears
Thanks to Jeanne for the suggestion-that does help to identify the matched
pairs, but it doesn't account for loss in the number of observations that
are identified as part of a matched pair when the ATE option is invoked.

Garth Rauscher
Associate Professor of Epidemiology
Division of Epid/Bios (M/C 923)
UIC School of Public Health
1603 West Taylor Street
Chicago, IL 60612
ph: (312)413-4317
fx:  (312)996-0064
em: [hidden email]
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jeanne Sears
Sent: Sunday, April 04, 2010 3:08 PM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

...
Since _weight holds the frequency a particular observation was used as a
match (and is missing if the observation was not a control or used as a
match), this may do the subsetting part of what you want:

drop if _weight==.

--
Jeanne Sears, PhD, MS, RN
Research Scientist
Department of Health Services &
Center for Healthcare Improvement for Addictions, Mental Illness
and Medically Vulnerable Populations (CHAMMP)
University of Washington
Box 354809
Seattle, WA  98195

e-mail: [hidden email]



Date: Sat, 3 Apr 2010 08:03:56 -0700
From: "Ariel Linden, DrPH" <[hidden email]>
Subject: st: RE: psmatch2-identifying matched pairs

Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

Date: Fri, 2 Apr 2010 13:57:53 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

I managed to figure out how to identify and subset my data to include only
the matched pairs created by psmatch2. What was (and still is) confusing me
was that if I included the ate option, some of the matched pairs were
"broken" and a member of the pair was no longer identified as such. I don't
understand why this happened, but, nonetheless for my purposes, leaving off
the ate option allowed the following code to work:

- - ---------------------------------------------------------------------
psmatch2 path2, pscore(p_prodterms) outcome(binarystage) caliper(.001)
noreplace neighbor(1)

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
- - ---------------------------------------------------------------------

This code creates the variable pair that identifies the matched pairs.


I forgot to mention- Hat tip to the authors of psmatch2 for providing this
partial solution...

- - ------------------------------------------------------------------------
The following code:

gen pair = _id if _treated==0
replace pair = _n1 if _treated==1

creates a variable that identifies the matched pairs but also includes those
within the region of support who are not included in a matched pair. I
cannot figure out how to drop those observations that are not part of a
matched pair. Any help would be appreciated.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: psmatch2-identifying matched pairs

Ariel Linden, DrPH-2
In reply to this post by Garth Rauscher
Hi Garth,

I haven't looked at the specific lines of code in PSMATCH2, but it seems
likely to me that the algorithm runs the ATT, then ATU, then ATE last. Each
iteration will naturally change the matches, since ATT means finding
controls to match to treated, ATU means finding treated to match to
controls, and ATE looks to adjust all units to get at the population average
effect.

To test this, try running the code in order ATT, ATU, and ATE, and review
the matches after each iteration. See if they change, and if they are
dropped after ATE.

Finally, you can email the authors of PSMATCH2. I have contacted them in the
past and found them very helpful.

Ariel


Date: Sun, 4 Apr 2010 23:43:32 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

Thanks to Ariel for the explanation. To estimate the average treatment
effect in the population (ATE) it makes sense that the 1:1 matching would
not be used. However, with the ATE option in PSMATCH2, the output also
includes estimates of ATT and ATU along with ATE, therefore it would seem
that the program would still need to know the matched pairs in order to
estimate ATT. Therefore I don't understand why the identified pairs change
and some appear to be "broken".

Garth Rauscher
Associate Professor of Epidemiology
Division of Epid/Bios (M/C 923)
UIC School of Public Health
1603 West Taylor Street
Chicago, IL 60612
ph: (312)413-4317
fx:  (312)996-0064
em: [hidden email]
 

- -----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ariel Linden,
DrPH
Sent: Saturday, April 03, 2010 10:04 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: RE: psmatch2-identifying matched pairs

Garth Rauscher
Hi Ariel, I'm sure that explains it.

In an attempt to wrap up this thread, let me review my original question and
the solution that was provided.

Objective: To identify the matched pairs that are created by the psmatch2
command.

The code below performs 1:1 nearest neighbor matching without replacement
and creates a new dataset named "paired" that contains the variable "pair"
that identifies which matched set each observation belongs to.

//--------------------------------------------------------------------------
psmatch2 xvar, pscore(pvar) outcome(yvar) caliper(.001) noreplace
neighbor(1)
gen pair = _id if _treated==0
replace pair = _n1 if _treated==1
bysort pair: egen paircount = count(pair)
drop if paircount !=2
save paired, replace
//--------------------------------------------------------------------------

Having the variable "pair" enables me to use the dataset of matched pairs to
run matched analyses in other stata commands or other software programs.

Thanks again for everyone's help. I have other questions about psmatch2 and
as I begin to articulate them I will start a new thread.

Garth


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ariel Linden,
DrPH
Sent: Monday, April 05, 2010 10:41 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

Hi Garth,

I haven't looked at the specific lines of code in PSMATCH2, but it seems
likely to me that the algorithm runs the ATT, then ATU, then ATE last. Each
iteration will naturally change the matches, since ATT means finding
controls to match to treated, ATU means finding treated to match to
controls, and ATE looks to adjust all units to get at the population average
effect.

To test this, try running the code in order ATT, ATU, and ATE, and review
the matches after each iteration. See if they change, and if they are
dropped after ATE.

Finally, you can email the authors of PSMATCH2. I have contacted them in the
past and found them very helpful.

Ariel


Date: Sun, 4 Apr 2010 23:43:32 -0500
From: "Garth Rauscher" <[hidden email]>
Subject: st: RE: RE: psmatch2-identifying matched pairs

Thanks to Ariel for the explanation. To estimate the average treatment
effect in the population (ATE) it makes sense that the 1:1 matching would
not be used. However, with the ATE option in PSMATCH2, the output also
includes estimates of ATT and ATU along with ATE, therefore it would seem
that the program would still need to know the matched pairs in order to
estimate ATT. Therefore I don't understand why the identified pairs change
and some appear to be "broken".

Garth Rauscher
Associate Professor of Epidemiology
Division of Epid/Bios (M/C 923)
UIC School of Public Health
1603 West Taylor Street
Chicago, IL 60612
ph: (312)413-4317
fx:  (312)996-0064
em: [hidden email]
 

- -----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ariel Linden,
DrPH
Sent: Saturday, April 03, 2010 10:04 AM
To: [hidden email]
Subject: st: RE: psmatch2-identifying matched pairs

Garth

Per your question about ATE and dropped matches: That makes intuitive sense
since the ATE represents the average treatment effect in the population.
Therefore, you would need to have the outcome values of the entire
population, not just the subset of matched controls. As a result, you would
no longer have 1:1 matches.

Ariel

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: psmatch2-identifying matched pairs

smithgiri
This post has NOT been accepted by the mailing list yet.
In reply to this post by Garth Rauscher
Dear All,

I am a new user of psmatch2 in STATA. I am trying to study the survival differences between two tumor types after propensity score matching (1:1 ratio, nearest neighbour) to match for age, sex, year of cancer diagnosis and racial and tumor stage.

After propensity matching, i was able to create unique matched pairs for each matched set (1 case and 1 control) by following earlier suggestions by Garth.  

My question is after identifying the pairs, how do i proceed for calculation of the Mcnemar's statistic for categorical variables and paired cox regressions for survival calculations. I found a complicated way to do the Mcnemar's test, but is there an easy way to do this after identifying the matched pairs.

Thanks in advance.

Smith Giri
University of Tennessee Health Science Center  
Loading...