Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Kartika Sari <kartika.sj@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Calculate individual distance from other group members |

Date |
Tue, 23 Feb 2010 21:45:58 +0100 |

Austin, Thanks for your reply. Yes, i would like to have something like that. But, its turn out the actual data is more complicated than the hypothetical I made before. I have 74 wards. and for the Group, it is not uniform at 5, it is from 1 to 7. So? Best regards, Kartika 2010/2/23 Austin Nichols <austinnichols@gmail.com> > Kartika Sari <kartika.sj@gmail.com>: > Like so? > > clear all > input gid id ward d1 d2 d3 d4 d5 > 1 1 3 10 4 0 9 7 > 1 2 1 0 6 10 8 5 > 1 3 2 6 0 4 11 3 > 1 4 1 0 6 10 8 5 > 1 5 2 6 0 4 11 3 > end > forv i=1/5 { > bys gid (id): assert id[`i']==`i' > bys gid (id): g i`i'=d`=ward[`i']' > } > l, noo > > On Tue, Feb 23, 2010 at 11:22 AM, Kartika Sari <kartika.sj@gmail.com> > wrote: > > Dear All, > > > > In my data, I have a distance matrix of wards for each individual. I > also > > know in which ward they live. The problem is i want to calculate ward > > distance from each individual to each of other members in a group. Say > there > > are 5 people in a group, so I need to calculate distance for 4 others for > > each person. I am wondering whether there is any syntax for this. > > > > The structure of data is something like this: > > > > group_id individual_id ward dtoward1 dtoward2 dtoward3 dtoward4 dtoward5 > > distance1? distance2? distance3? distance4? > > 1 1 3 10 4 0 9 7 > > 1 2 1 0 6 10 8 5 > > 1 3 2 6 0 4 11 3 > > 1 4 1 0 6 10 8 5 > > 1 5 2 6 0 4 11 3 > > > > Thank you very much in advanced. > > > > Best regards, > > Kartika > > > > * > * 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/ > * * 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/

**Follow-Ups**:**RE: st: Calculate individual distance from other group members***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**References**:**st: Calculate individual distance from other group members***From:*Kartika Sari <kartika.sj@gmail.com>

**Re: st: Calculate individual distance from other group members***From:*Austin Nichols <austinnichols@gmail.com>

- Prev by Date:
**st: RE: regression r(103): too many variables** - Next by Date:
**RE: st: Calculate individual distance from other group members** - Previous by thread:
**Re: st: Calculate individual distance from other group members** - Next by thread:
**RE: st: Calculate individual distance from other group members** - Index(es):