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

st: AW: psmatch2 by(var)

From   "Martin Weiss" <>
To   <>
Subject   st: AW: psmatch2 by(var)
Date   Thu, 26 Mar 2009 10:06:57 +0100


Can you not use -levelsof- to imitate the effect of -by-?

sysuse auto, clear

bysort rep78: reg pr tr tu

* other way to achieve same result
levelsof rep78, loc(myreps) miss
foreach lev of local myreps{
	reg pr tr tu if rep==`lev'


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Nils Kok
Gesendet: Donnerstag, 26. März 2009 09:22
Betreff: st: psmatch2 by(var)

Dear statalist,

Using psmatch2 I compare differences between a group of treated and
non-treated observations. However, within these groups I want to distinguish
further between different geographical locations (MSAs): for each MSA, I
want to match a treated observation with the most comparable non-treated
observation (as indicated by the pscore). Then, I want to test the
differences in outcome variables for all pairs in all MSAs. The 'by()'
option would be ideal. However, this is not available in psmatch2. What are
the alternatives.

Thanks in advance,

Nils Kok

*   For searches and help try:

*   For searches and help try:

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