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

st: Sorting Data

From   "Mkenda A.F" <>
Subject   st: Sorting Data
Date   Wed, 13 Nov 2002 18:16:30 +0300

I have the followig type of data that I want to sort in a way that I will
		Table 1 ( Year 1980)
Country     vote1   vote2   vote3   vote4   vote5 etc 
USA          Y       N       Y       Y       A       
Albania      N       Y       N       N       Y
Algeria      N       Y       Y       A       Y
Argentina    Y       N       Y       Y       Y

This data is of the UN general assembly voting on different resolutions and 
it repeats itself for twenty years (1980 to 2000).  

I want to constuct a variable for each country to represent the number of
times that
each country votes in line with the way USA votes. I am thinking of doing
the following:

In the first step to assign one (unit) to each vote that is the same as the
vote casted (or
not casted) by the USA and zero to each vote that differs with the US vote
on the same resolution.
Thus the data above would look like:

		Table 2 (Year 1980)
Country   vote1   vote2    vote3   vote4    vote5  etc
Albania    0       0         0       0       0   
Algeria    0       0         1       0       0
Argentina  1       1         1       1       0

Thereafter I am thinking of making a row-wise summation to get a new
variable for the frequency that
a country voted in tune with the USA.

I'll very much appreciate if anyone can suggest to me a simple program for
reorganising the
data from Table 1 above to Table 2 and making the row-wise summation for
each country for each year.


A. F Mkenda
University of Dar es Salaam


*   For searches and help try:

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