Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Reshaping data from list form and grouping by one variable


From   Daniel Tucker <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Reshaping data from list form and grouping by one variable
Date   Wed, 8 Jan 2014 13:16:31 +0000

Hello all,

I’m relatively new to STATA and was wondering whether you 
could help me. I am trying to construct a dataset of every countries 
contiguous borders. I currently have a list of all of the land   borders
 in the form of:

StateA, StateB
AFG, CHI
AFG, IRA
AFG, PAK
… and so on.

In total there are 618 observations. I want to instead have it so that the
 StateA variable has only unique values and all of its relationships are
 listed in the following manner:
StateA, StateB1, StateB2, StateB3...
AFG, CHI, IRA, PAK...ALB, GRE, MAC, MTG ...

The most land borders is 15 so it would have to go up to StateB15. I am 
unsure if there is a command which would help me to do this and would 
much appreciate any assistance that you could provide. If not, I will 
have to input it manually. Thanks in advance for your assistance.
Kind regards,

Daniel Tucker

MSc Security Studies Student
Department of Political Science,
University College London. 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index