Statalist The Stata Listserver

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

st: Re: Using NEARMRG

From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
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
[email protected]

----- Original Message ----- From: "MA V" <[email protected]>
To: <[email protected]>
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:

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