Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: creating a variable for neighbors


From   "helen milner" <[email protected]>
To   <[email protected]>
Subject   st: RE: creating a variable for neighbors
Date   Thu, 6 Feb 2003 16:04:41 -0500

Dear Stata-listers,

I have a country-year dataset with a variable for the number of users of
product X for each country year. There are 200 countries and 20 years. I
would like to create a variable for country I in year t that is the
average of its contiguous neighbors' # of users of product X in year t.
(Unfortunately, while a country's neighbors is usually time invariant,
it is not always time-invariant as countries are born and die). 

What I can't figure out is how to identify for each country its
neighbors, without adding like 200 variables for each country and making
dummies for each neighbor. 

Is there some way to do this that is less complex?

Thank you for any suggestions.

Helen Milner
Columbia University



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index