Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65574

Counting different types of duplicates

$
0
0
Hi,
I have a dataset for different local governments (more than 300) with information of elected council members for three different years. I'm trying to create an Herfindahl index based on the concentration of parties within each council. I have a data set that looks like this:
Local Government Year of election Party
A 2000 P.1
A 2000 P.2
A 2000 P.1
A 2000 P.3
A 2000 P.2
A 2004 P.4
A 2004 P.6
A 2004 P.1
A 2004 P.6
B 2000 P.2
B 2000 P.7
B 2000 P.1
B 2000 P.1
B 2004 P.1
B 2004 P.2
B 2004 P.8
B 2004 P.2
B 2004 P.8
B 2004 P.1
Note: Councils differ in number by local government and year. Party variable is a categorical variable that ranges from 1 to more than 200 (parties might change their name across the country but not within each council)

What I need is for each year and local government the share of each party in the council. That is, for example for LocalGov A in year 2000, that P.1 has 2 positions out of 5, P.2 also 2 out of 5, and P.3 only one position of the total five. I've tried using duplicates tag, installed both unique, distinct and egenmore commands, but I haven't been able to create a summary variable with the information needed to build the index.

Thanks in advance for any tip.

Franco

Viewing all articles
Browse latest Browse all 65574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>