Dear All,
It must be something simple but I couldn't find any help on web. I wanted to know whether it is possible to generate a sex ratio variable which when used can give the sex ratio by area and by different district in a table.
For example If I use the following syntax I can only get the sex ratio by Area
egen male=(sex==1) , by(area)
egen female=(sex==2), by(area)
gen sexratio=male/female
So if I want by District I have to generate a new variable. I want to know whether its is possible to generate a sex ratio variable which can used in generating a table of sex ratio by Area and District with one variable of sex ratio instead of having to generate new variables for each level (Area and District)
Thank you
Related Posts with Calculating sex ratio
Why do I have missing categories from a newly created categorical variableI want to create a new variable with multlple categories based on an existing categorical variable i…
Keeping observations within a daterange of a focal observation of interestDear all, I'm trying to keep observations that satisfy a relatively simple condition, but am unable…
error using 'xsmle' : "initial values not feasible r(1400)"Hello, I am studying a spatial dimension of the regional real estate prices. I use panel data (Data…
Econometric QueryI want to estimate the effect of adoption of a policy (POL1) by firms on their Value (Y). The adopti…
Identify weekdays for the high and low points in time series analysisDear all, I have a question about how to identify the weekday of the high and low points in time se…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating sex ratio
Post a Comment