Hello dear all,
I am facing a serious problem to use the command proportion. I have a series of neighborhoods (psu) , within milieu which is also within a province. I am trying to get the proportion of people of the same tribe in each neighborhood in vain. In my dataset tribe is coded as 3digits figure. Whenever I try
by prov milieu psu, sort: prop tribe
Stata refuses to apply prop and responds that proportion does not work with "b". When I change and
proportion (tribe), over (psu) Stata says I have too much options while the same command works with a variable like "sex" with only two options instead of "psi" which corresponds to 660 modalities. I have tried to write loops for that but still I cannot manage to get the right one. I will much appreciate you help.
Thanks in advance
Related Posts with Calculating proportions of several categories
Discrete choice experiment : WTP with effects codingHello, I'm afraid this is not strictly a stata question. I have conducted a Discrete choice experime…
Break in consecutive values to identify groupsSuppose I have a dataset like this: clear set obs 20 gen x = 1 gen id = 1 in 1/10 replace id = …
Tabout and Fre suddenly not working?For some reason when I export frequency tables to excel and/or word (as .csv or .rtf files), they ar…
Multilevel regresion code doubtHi all, I have date of 100 employees per company, for several companies. I would like to perform a …
Keep a group of observations if one record meets a certain conditionHi All, Here's an example of the sort of dataset that I'm working with: clear input studyid edvisi…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating proportions of several categories
Post a Comment