Hello!
I don't know if this is more a technical issue or a methodical one and I'm sorry if this forum is the wrong place for it.
But my issue is the following. I have a data sample with election data over the course of several years. The cases are individual candidates for a single election. Now I want to calculate the margin of victory for each case.
I think I can identify a certain election via a combination of variables like year, location, etc. However, I don't know how I would go about constructing a command, that subtracts the vote share of the candidate coming in second from the vote share of the winning candidate in a given election.
I was thinking to maybe use a loop that activates and deactivates filters that change value (of a variable identifying an election) and for each value calculate the victory margin.
Is there a less complicated way for that? And how would I go about creating such a variable identifying unique elections based on 2 or 3 other variable values?
I'd be glad if someone could help me or point me to other ressources :)
#SPSSStatistics#Support#SupportMigration