Dear Stata users,
I am new to stata and am working on a dataset with 20 mio. people for two years with zipcodes for each person to identify the municipality they live in.
I have the following question:
I want to create a variable that gives me the literacy rate for each municipality (zipcode).
I have a dummy variable that tells me if an individual is literate and I have the total number of people that live in each municipality; I also have a weight for sample expansion (since not the whole population is represented in my dataset).
I tried creating said variable with the following code, but if I summarize my literacy rate variable it does not give me a reasonable number (between 0 and 1).
egen literation = sum(literacy) if literacy == 1, by(zipcode)
gen literacy_rate = literation/popcount
My question is: how do I include the sample weights into the literacy_rate variable?
Thanks in advance for tips where I can read up on this.
Related Posts with Create a rate variable for population as a whole with sample weights
svyset: missing standard error because of stratum with single sampling unitSince the dataset I'm using has a Stratum (v022) with only one PSU (v021), and I have to use the fol…
Regression by yearHi all, I have a dataset that includes a list of information on companies from 2000-2014. I am loo…
Weighting of Indian Demographic Health Survey (2015-16) dataUsing the Indian DHS 2015-16 data for my analysis, I have merged three files together (1) Person fil…
zoib regressionHi everyone, I have used the zero-one inflated beta regression but I have concerns. My dependent var…
metaprop - show subgroup pooled estimates onlyI using metaprop on 160 studies, subgrouping data by country. I want to suppress the study-level est…
Subscribe to:
Post Comments (Atom)
0 Response to Create a rate variable for population as a whole with sample weights
Post a Comment