Hey everyone,

I am using Stata 16 on Mac.

I am trying to create a new variable from the percentages I obtained from a frequency table.

The data contains individuals that live in different villages and took part in an election or abstained. To measure the voter turnout by village, I created a frequency table including the percentages using the following command:

Code:
tab village vote_brgy, row

This is a part of the resulting frequency table:
Code:
+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

               |     Voted at
               |       elections
       village |         0          1 |     Total
---------------+----------------------+----------
   Balac-Balac |         2         25 |        27 
               |      7.41      92.59 |    100.00 
---------------+----------------------+----------
         Baras |         2         25 |        27 
               |      7.41      92.59 |    100.00 
---------------+----------------------+----------
   Batonan-Sur |         0         27 |        27 
               |      0.00     100.00 |    100.00 
---------------+----------------------+----------
        Bucaya |         0         27 |        27 
               |      0.00     100.00 |    100.00

What I want to do now is create a new variable that contains the voter turnout (i.e. 92% vor Balac-Balac). This percentage should be displayed for every participant that lives in that village. It is important to mention that there are a lot of missing variables for this variable. For example there were 56 participants from Balac-Balac, but only 27 answered the question regarding their voting behaviour in the last election. I thought to do this by hand but there are many different villages so I hope to avoid that.

I hope I clearly stated my problem.

Thank you in advance for your time and best regards
Charles Ehmat