I think this is a simple question. I have a categorical variable (85 departments) in a long data set with multiple years/department. I use by, sort, & egen to calculate the % male in each department. However, I only want to use 1 year. How do I code that?
Right now I have
by department female, sort: generate male = _N
by department: generate percentmale = 100 * male / _N
thank you...
Related Posts with Sort
How to print values in parenthesis when using a matrix with esttab?So I generate a lot of tables where I have to use parenthesis (e.g mean (SD) format). The problem is…
cmissing having no effectI am trying to create a line graph that does not connect when there are observations with missing da…
Issue with svyset, getting "command svyset_8 is unrecognized"Hello all, I am in the process of analyzing some data from the National Readmissions Database (NRD)…
Creating portfolios with double sorting and calculating mean returns of the portfolios.(please help)This is the third time I write this topic but did not get any answer from statalists members, and ca…
xtbcfe erroeDear All, I am trying to use the user written routine xtbcfe for bias corrected fixed effect estima…
Subscribe to:
Post Comments (Atom)
0 Response to Sort
Post a Comment