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
Constraints does not work in gsemHello, I want to add constraints to a gsem model. I have multiply imputed data and I want to first …
Simulating skewed variable bound by zeroHi, I'd like to simulate a variable with a negatively skewed distribution, bound by zero on the low…
Coefficient comparison across two sub-samples regression with reg3Hi all, I was wondering if there is a way to make meaningful inferences on the coefficients that ar…
Comparing regression coefficients of different independent variables in separate regressionsDear all, Suppose I have the following dataset Code: input dv iv1 iv2 firmid year 1 8 1 155 2001 …
"prodest"- the markup estimate of the first year of datasetDear, I have a question regarding the first year markup estimate that I get from the command "prode…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a percentage variable
Post a Comment