Hello all!
I am trying to combine the psmatch2 command with exact matching. More specifically, I am trying to adapt the code given in "help psmatch2" so as to only get a pscore for each observation (I estimate the ATT later taking a differences-in-differences approach).
Below is the code provided in Stata:
Matching within strata
The following code illustrates how to match within exact cells and then calculate the average effect for the whole population.
g att = .
egen g = group(groupvars)
levels g, local(gr)
qui foreach j of local gr {
psmatch2 treatvar varlist if g==`j', out(outvar)
replace att = r(att) if g==`j'
}
sum att
and below is what I immediately thought of doing:
global psmlist x y z
probit treatvar $psmlist
predict double p, pr
g p2=p
egen g=group(groupvars)
levels g, local (gr)
qui foreach j of local gr {
psmatch2 treatvar $psmlist if g==`j', pscore(p2) caliper (0.01) norepl common
replace p2 = r(p2) if g==`j'
}
which yields the exact same result as for the predicted p variable (which doesn't include exact matching). I also do not get any of the usual variables that comes with psmatch2 (i.e. _id, _n1 etc)
Clearly I don't fully understand the original code. Can someone help me out, please?
PS: I have already estimated p2 using the code detailed here: https://www.stata.com/statalist/arch.../msg00073.html , but my supervisor recommended that I try to modify the officially given code instead.
Many thanks!
Melanie
Related Posts with psmatch2 and exact matching
Merge: variable does not uniquely identify observations in the master dataHi everyone, I have a data with a variable household ID that does not uniquely identify observation…
psmatch2Hello! When I use the syntax psmatch2 chronic1 `covariates' , logit common caliper(.001) neighbor(1)…
Graphic Processing Units and Time Series AnalysisI have been running ARCH/ARMAX models on an overclocked machine that has a clock speed of 5 GHz. Unf…
computed and store chi2Hello stata users, Thank you for taking the time to address my concern. (and sorry for my english..…
Generating measures of repeat collaboration between firms over timeDear Statalist. I am trying to generate 2 separate measures of repeat collaboration between firms c…
Subscribe to:
Post Comments (Atom)
0 Response to psmatch2 and exact matching
Post a Comment