POLMETH Archives

Political Methodology Society

POLMETH@LISTSERV.WUSTL.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Moshe Haspel <[log in to unmask]>
Reply To:
Political Methodology Society <[log in to unmask]>
Date:
Fri, 29 Sep 2006 14:11:38 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (123 lines)
Eric,

The collapse command should do the trick. Depending on the structure of 
your data, you may need to do a reshape first.

A couple of things you might consider when planning your collapse:

Depending on precisely what you are trying to measure, it may make sense 
to consider each county to be its own neighbor as well.
Since counties are presumably of different sizes, a weighted average would 
probably be a good idea for any proportions.



=============================================
Moshe Haspel, Ph.D.
Assistant Professor, Department of Political Science
Spelman College
Giles 215
350 Spelman Lane SW, Box 207
Atlanta, GA  30314
404-270-5654 (phone)
404-270-5666 (fax)



eric magar <[log in to unmask]> 
Sent by: Political Methodology Society <[log in to unmask]>
09/29/2006 11:44 AM
Please respond to
[log in to unmask]


To
[log in to unmask]
cc

Subject
[POLMETH] Neighbours' average in stata






Dear colleagues:

I will be grateful for help on something that should be easy to
do in Stata but I am unfamiliar with. I have observations at the
county level and wish to compute the average value of certain
quantities of interest in neighbouring counties, such as the
average share of the two-party vote.

My dataset has info on which counties are neighbours, ie those
sharing a border with the current observation. This is coded as
a series of variables listing each a neighbouring county, in no
special order. Once the listing for a county is complete, the
remainder neighbour variables adopt missing values. A simple
example with four counties arranged in a line would be:

cty    vote  nei1  nei2
  1    0.45     2     .
  2    0.59     1     3
  3    0.51     4     2
  4    0.43     3     .

How can I get the average vote in neighbouring counties? My
dataset is quite large, so doing it case by case would take too
long.

Thank you and best wishes,

--e

______________________
Eric Magar
Ciencia Política, ITAM
Mexico City



--
La información contenida en este mensaje de datos es confidencial,
constituye un secreto industrial y/o profesional en términos de la
legislación vigente y se encuentra dirigida exclusivamente al
destinatario indicado en dicho mensaje. Si usted recibe esta información
por error o si usted no es el destinatario del mensaje, favor de
notificar al emisor, y destrúyalo.

The information contained in this electronic message is confidential,
it constitutes a profesional and/or industrial secret in terms of the
current legislation, and is intended for its recipient only. If you
receive this message by mistake and/or if you are not the recipient
thereof, please notify the sender and destroy it.

**********************************************************
             Political Methodology E-Mail List
        Editor: Karen Long Jusko <[log in to unmask]>
**********************************************************
        Send messages to [log in to unmask]
  To join the list, cancel your subscription, or modify
           your subscription settings visit:

          http://polmeth.wustl.edu/polmeth.php

********************************************************** 

--
This message has been scanned for SPAM and viruses by the Spelman College 
SPAM Administration system.  It is believed to be safe and clean. 

**********************************************************
             Political Methodology E-Mail List
        Editor: Karen Long Jusko <[log in to unmask]>
**********************************************************
        Send messages to [log in to unmask]
  To join the list, cancel your subscription, or modify
           your subscription settings visit:

          http://polmeth.wustl.edu/polmeth.php

********************************************************** 

ATOM RSS1 RSS2