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
Out-of-Sample Prediction using Multinomial Logit ModelHi I have a question about the out-of-sample prediction using multinomial logit model. <Situatio…
Xtlogit vs Logit.Dear respected Members, I’m not professional in Stata. Sorry, Pls could anyone help and offer me an …
Calculating sample size with more parametersHello, I am trying to calculate sample size with the parameters below. I used the code below to cal…
multiple criteria across several variablesHi there Sorry if this is really basic, but I want to flag every observation where both values 3 an…
2SLS on Panel DataHi guys! I'm using 2SLS on Panel Data, however when I calculate 2SLS manually, I mean, by doing: F…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a percentage variable
Post a Comment