Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: psmatch2 and matching within the metropolitan area


From   "Millimet, Daniel" <millimet@mail.smu.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: psmatch2 and matching within the metropolitan area
Date   Fri, 7 Apr 2006 14:07:53 -0500

I can't give you an overview over email.  Plus, my knowledge is limited.
But it might look something like:

clear
set obs 0
save c:\results, replace

use YOURDATA
*assuming 4 metro areas
forvalues i=1/4 {   
preserve
keep if metro==`i'
psmatch2 ...
keep outcome _outcome metro
append using c:\results
save c:\results, replace
restore
}

use c:\results, clear
gen ate=outcome-_outcome
su ate, meanonly


and then to bootstrap it:

clear
set obs 0
save c:\bsresults, replace

forval b=1/500 {
clear
set obs 0
save c:\results, replace


use YOURDATA, clear
bsample
forvalues i=1/4 {   
preserve
keep if metro==`i'
psmatch2 ...
keep outcome _outcome metro
append using c:\results
save c:\results, replace
restore
}

use c:\results, clear
gen ate=outcome-_outcome
su ate, meanonly
replace ate=r(mean)
gen b=`b'
keep b ate
keep if _n==1
append using c:\bsresults
save c:\bsresults, replace

}

use c:\bsresults, clear
su ate, d




****************************************************
Daniel L. Millimet, Associate Professor
Department of Economics
Box 0496
SMU
Dallas, TX USA
phone: 214.768.3269
fax: 214.768.1821
web: http://faculty.smu.edu/millimet
****************************************************

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Hui-shien
Tsao
Sent: Friday, April 07, 2006 12:37 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: psmatch2 and matching within the metropolitan area

Thank you for your valuable suggestions, but I am a beginner user of 
Stata.  Could you please point me to the right direction where I can 
find sample syntax to do what you describe?  Thanks again!

Hui-shien

Millimet, Daniel wrote:
> You should write a short do file where you keep one metro area at a
> time, do psmatch2, save the outcomes and the generated counterfactual,
> compute the overall ATT/ATE/ATU by hand as the mean difference once
you
> have looped over all metro area, and then finally bootstrap the
standard
> error(s).
> 
> Dann
> 
> ****************************************************
> Daniel L. Millimet, Associate Professor
> Department of Economics
> Box 0496
> SMU
> Dallas, TX USA
> phone: 214.768.3269
> fax: 214.768.1821
> web: http://faculty.smu.edu/millimet
> ****************************************************
> 
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Hui-shien
> Tsao
> Sent: Friday, April 07, 2006 11:41 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: psmatch2 and matching within the metropolitan area
> 
> Hi all ---
> 
>      I am using psmatch2 to conduct propensity score matching.  My
data 
> is a pool of cases from four metropolitan areas.  I would like to
match 
> the treated tracts to the untreated tracts within the same
metropolitan 
> area.  I have tried to create dummy variables to control for 
> metropolitan areas.  However, some of the matches still pick tracts
from
> 
> a different metropolitan area.  Is there any way I can match within
the 
> same metropolitan area?  Thank you for your help in advance.
> 
> Hui-shien
> 
> *****
> Here is my syntax:
> 
> gen random=uniform()
> sort random
> psmatch2 treat metro1 metro2 metro3 var1 var2 var3 var4, logit 
> neighbor(1) common trim(3)
> 
> A simplified data structure:
> 
> id	metro	treat	Var1	Var2	Var3
> 1	1	1	1	4	4
> 2	1	0	2	1	3
> 3	1	0	3	1	1
> 4	1	0	3	5	2
> 5	1	1	2	3	5
> 6	2	0	1	1	3
> 7	2	0	1	2	8
> 8	2	0	2	5	6
> 9	2	0	3	3	3
> 10	2	1	3	7	1
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index