Hello everyone,
I have a dataset with Italian data on electoral outcomes. My dataset contains information about all the election years (from 1987 to 2013), provinces, municipalities, eligible voters, actual voters, parties, and votes per party. My goal is to have the dataset at the province level with the votes for the political parties in the election years, together with all the eligible and actual voters.
I, therefore, used this command: collapse (sum) votes eligibles voters, by (province party year).
It works but I obtain different numbers of voters for the same province in the same year...which is wrong.
Where do you think I am doing wrong?
Thank you in advance for your help!!
Related Posts with Problems with collapse command
vce(cluster var1 var2) varlist not allowed r(101)Hi!, I am trying to run fixed effect with two-way clustering. For instance: reghdfe capx x1 x2, abs…
Replace if value is a dateHi, I am trying to replace the value of one variable when the condition holds (the condition is that…
calculating the number by comparing this period and previous periodDear All, Suppose that I have this data Code: * Example generated by -dataex-. To install: ssc inst…
Identifying sequences in string variables across observationsHello. I have string data in the format described below. I want to generate a new variable "Pregnanc…
keep observations between staryear and endyear.Dear All, I have this dataset, Code: * Example generated by -dataex-. To install: ssc install datae…
Subscribe to:
Post Comments (Atom)
0 Response to Problems with collapse command
Post a Comment