Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: [UNCLASSIFIED] SSC nearmrg comand, genmatch option gives wrong results.
From
"Lucchino, Paolo" <[email protected]>
To
<[email protected]>
Subject
st: [UNCLASSIFIED] SSC nearmrg comand, genmatch option gives wrong results.
Date
Mon, 8 Nov 2010 10:18:51 -0000
Nick,
Thanks very much for your help and apologies for not quoting the source of the program.
Your suggestion is correct and now the program can run.
I also had to fix the stable option in the sort command (as documented in http://www.stata.com/statalist/archive/2009-08/msg00459.html)
However, I still have problems with the program as the variable generated by the genmatch option is wrong (see results below).
I'm contacting the first author, but also posting here in case someone has any suggestions.
Examples of datasets, commands used and (wrong) results at the end of this trail.
Thanks,
Paolo
-------------------------
Nick [email protected]
I guess further that you may need to clone -nearmrg- and change references to `work' to references to "`work'", i.e. add extra double quotes.
--------------------
Lucchino, Paolo
I'm having some problems getting the command nearmrg to work. I get this error message:
invalid 'Settings'
r(198);
---------------------
file ageinfo1
+----------------------------+
id gender age income
----------------------------
1. 1 1 34 23
2. 2 2 40 43
3. 3 1 25 21
4. 4 1 12 56
5. 5 2 18 75
+----------------------------+
file ageinfo 2
+------------------+
id gender age
--------------------
1. 12 2 34
2. 213 2 40
3. 314 1 25
4. 415 1 12
5. 516 2 18
+-------------------+
use ageinfo1, clear
sort gender age
save, replace
use ageinfo2, clear
sort gender age
nearmrg gender using ageinfo1, nearvar(age) lower genmatch(newage)
+-------------------------------------------------------+
id gender age income _merge newage
+-------------------------------------------------------+
415 1 12 56 3 1
314 1 25 21 3 3
516 2 18 75 3 2
12 2 34 75 3 2
213 2 40 43 3 5
+-------------------------------------------------------+
**********************************************************************
If you have received this email and it was not intended for you,
please let us know, and then delete it. Please treat our
information in confidence, as you would expect us to treat yours.
All our information systems may be monitored to ensure
that they are operating correctly. Furthermore, the content of
emails and other data on these systems may be examined,
in exceptional circumstances, for the purpose of investigating
or detecting any unauthorised use.
The original of this email was scanned for viruses by the Government Secure Intranet virus scanning service supplied by Cable&Wireless Worldwide in partnership with MessageLabs. (CCTM Certificate Number 2009/09/0052.) On leaving the GSi this email was certified virus free.
Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.
*
* 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/