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, statalist.org is already up and running.

# Re: st: Matched ID in Kernel Matching (PSMATCH2)

 From Santosh Kumar To statalist@hsphsun2.harvard.edu Subject Re: st: Matched ID in Kernel Matching (PSMATCH2) Date Tue, 28 Sep 2010 16:09:14 -0400

```Dear Austin,

I followed your syntax for weighting and then ran OLS. But why does it
drop the treatment variable, that is "improved" in my regression. Are
"t" and "w" collinear?

Santosh

su improved, mean

. loc m=r(mean)

. la var pscore "Estimated Propensity Score"

. g w=cond(improved,  `m'/(-`m'),pscore/(1-pscore))
(1876 missing values generated)

. xi: reg diarr improved  piped m_age h_age m_yrsch h_yrsch pucca
hindu muslim dsc dst dobc i.state i.vmonth awadi bpl elec [pw=w]
i.state           _Istate_1-34        (naturally coded; _Istate_1 omitted)
i.vmonth          _Ivmonth_1-12       (naturally coded; _Ivmonth_1 omitted)
(sum of wgt is   7.2979e+06)
note: improved omitted because of collinearity

Linear regression                                      Number of obs =  159136
F( 52,159083) =   80.28
Prob > F      =  0.0000
R-squared     =  0.5534
Root MSE      =  .21132

------------------------------------------------------------------------------
|               Robust
diarr |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
improved |  (omitted)
piped |  -.2922823   .1117145    -2.62   0.009    -.5112403   -.0733243
m_age |  -.0122199    .002744    -4.45   0.000    -.0175981   -.0068417
h_age |  -.0012004   .0029404    -0.41   0.683    -.0069635    .0045628
m_yrsch |   .0006469   .0011709     0.55   0.581    -.0016482    .0029419
h_yrsch |   .0015974   .0024514     0.65   0.515    -.0032072    .0064021
pucca |   .0967932   .0224104     4.32   0.000     .0528692    .1407171
hindu |   -.126827   .0434699    -2.92   0.004    -.2120271    -.041627

On Fri, Sep 24, 2010 at 1:02 PM, Austin Nichols <austinnichols@gmail.com> wrote:
> Santosh Kumar <santosh.uh@gmail.com>:
>
> Your -psmatch2- syntax is suspect, since you are not regressing a
> treatment indicator on controls.  That said...
> Why not reweight instead of match?
>
> la var t "Treatment"
> su t, mean
> loc m=r(mean)
> la var pvar "Estimated Propensity Score"
> g w=cond(t,`m'/(`-`m'),pvar/(1-pvar))
> la var w "ATT weight"
> logit y t x* [pw=w]
>
> Have you tried rerunning -psmatch2- multiple times to see if you get
> the same estimate every time?  My guess is that your estimate depends
> on the sort order of your data, which is an odd feature for any
> estimator.
>
>
> On Thu, Sep 23, 2010 at 12:38 PM, Santosh Kumar <santosh.uh@gmail.com> wrote:
>> Dear listserv,
>>
>> I want to use propensity score matching to match the treated with the
>> control. I am using Kernel matching. Instead of getting ATT, I want to
>> run a logistic regression on the matched sample. I am struggling to
>> create a matched sample in kernel matching. In nearest neighbor
>> matching, follwoing syntax will created a matched sample.
>>
>> 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
>>
>> Could anyone help me in creating a matched sample with Kernel Matching?
> *
> *   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/
```