Hello,
I have a categorical variable for ethnicity.
When I tabulate it I can see that there are percentages assigned to each one. I want to create a new variable called availability ratio which is basically= number of people belonging to ethnicity A over total population (i.e. it's the percentage that I see when I use the tab command).
I used the following command:
egen avail_ratio=pc(ethnicity)
but it doesn't work. It doesn't give me the right percentages.
Could somebody correct my command please?
Related Posts with How to create a percentage variable
Some curious features of tests in Stata with interactionsWhile preparing teaching material for my undergrads I noticed a peculiar, not to say undesirable, fe…
Univariate Evidence using t-statHello Stata Community, i have the attached dataset and I want to give an descriptive statistics ove…
Interpretation of -estat vif- findingsHi. I am using stata 16.1. I estimate a dynamic panel data model using the commando -xtreg, fe vce(r…
Exit Stata after run do-fileHi! I'm running a Python code that opens Stata and runs a do-file. After the do-file is run I would …
Exporting Stata GraphI sent Stata graph as tiff to the editors of a journal but the insist they would like them in a Micr…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a percentage variable
Post a Comment