I have a UN voting dataset – taken from a CSV file – where each row is in following format:
{venue, session number, resolution code, descriptor, full date, year, month, day, topic, country, vote code, vote}
I would like to indicate the vote coincidence between the US and another country for a given year and 'topic.' Sample (note that Botswana did not vote in res. '15294'):
UNGA2009 = {{"UNGA", 63, 15294, "...", "30-Jun-09", 2009, 6, 30, "B", "Argentina", 3, "YES"}, {"UNGA", 63, 15294, "...", "30-Jun-09", 2009, 6, 30, "B", "Cuba", 3, "YES"}, {"UNGA", 63, 15294, "...", "30-Jun-09", 2009, 6, 30, "B", "United States", 1, "NO"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "F", "Argentina", 2, "ABSTAIN"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "F", "Botswana", 2, "ABSTAIN"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "F", "Cuba", 1, "NO"} , {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "F", "United States", 3, "YES"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "H", "Argentina", 2, "ABSTAIN"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "H", "Botswana", 2, "ABSTAIN"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "H", "Cuba", 1, "NO"}, {"UNGA", 63, 15295, "...", "9-Sep-09", 2009, 9, 9, "H", "United States", 3, "YES"}}
With output looking something like this:
{15294, 2009, "B", "Argentina", 0}, {15294, 2009, "B", "Cuba", 0}, {15295, 2009, "F", "Argentina", .5}, {15295, 2009, "F", "Botswana", .5}, {15295, 2009, "F", "Cuba", 0}, {15295, 2009, "H", "Argentina", .5}, {15295, 2009, "H", "Botswana", .5}, {15295, 2009, "H", "Cuba", 0}
Where 0 is non-coincidence of the vote, 1 is coincidence, and .5 is partial coincidence (when one country abstains and the other votes either yes or no). Does anyone have any ideas on what the best method would be?
Thanks Again, Arebearit
{{"UNGA", 1, 10044, "GAOR-1-66", "1-Jan-46", 1946, 1, 1, "F", "United States", 3, "YES"}, {"UNGA", 1, 10044, "GAOR-1-66", "1-Jan-46", 1946, 1, 1, "L", "Canada", 3, "YES"}}
And output would be, say, a list containing ones or zeroes to indicate coincidence or non-coincidence. $\endgroup$