Hello, I have the following dataset where each observation rapresent an individual. the variable cittad takes value from 1 to 3 and show if a person have Italian citizenship or UE citizenship or extra UE citizenship. Prof1 provide information about the work activities carried out by each person and it range from 1 to 9. Occupazione is the sum of working people for each citizenship group and group of activities, prova_tot_occ is the sum of total worker by each group of citizenship (so the sum of the variable occupazione following the division under cittad) and occ_perc is the percentage of worker which perform the same activities over the total by each group of citizenship.
What I would like to do is to create a variable of control called verify that for each group of citizenship give me the sum of the occ_perc in order to verify that for each value of the variable cittad the sum of occ_per is = 1.
Thank you for you attention.
What I would like to do is to create a variable of control called verify that for each group of citizenship give me the sum of the occ_perc in order to verify that for each value of the variable cittad the sum of occ_per is = 1.
Thank you for you attention.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(cittad prof1) float(occupazione prova_tot_occ occ_perc) 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 1 1 7176 227523 .031539667 end
Comment