Statalist The Stata Listserver


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

st: Re: Using NEARMRG


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Using NEARMRG
Date   Wed, 26 Apr 2006 18:14:31 -0400

I'm the author of nearmrg. The help message is quite clear here and, although you may have tried "many things" it doesn't seem like those things included addressing the error message. The nearvar must be unique in the using dataset within levels of the varlist (region in your case). In your case, the combination of region and age do not uniquely identify the using dataset observations and so the nearest match can not be determined since there may be more than one. -nearmrg- serves as a lookup function and you have a lookup table with non-unique (and therefore ambiguous) values.

The sort order of your data does not matter since nearmrg appends the datasets together and does its own sorting.

Michael Blasnik
michael.blasnik@verizon.net


----- Original Message ----- From: "MA V" <ma_v@hotmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Wednesday, April 26, 2006 5:59 PM
Subject: st: Using NEARMRG



I just came across a very interesting function named "nearmrg" and I have a question regarding its use:
If I write:

neamrg region using ageinfo2, nearvar(age) keep

In this case, I have the following questions:
1) "age" must be unique in the using dataset, right?
2) does the variable region need to be unique?
3) how should I sort the variables?

I tried many different things and I always seem to get the message:

"region age not unique in using dataset
something that should be true of your data is not"

Any suggestions?
Thanks for your help!!
*
*   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