Hi,
I am trying to do the following. The command inequal7 is able to give various inequality measures for a sample. Now suppose that in my sample I make a distinction between low/medium/high education (0/1/2) and whether a person is married or not (0/1). The unit of observation is the individual. For a particular composite measure, I need to calculate the Mean Log Deviation (given by command inequal7 and stored in r(mld)) for each combination of education and married (so six in total). Once I have the six MLD values for each of the combinations, I need to take the weighted average to generate the final measure. As an example, medium education and married may occur 500 times in the dataset, while highly educated and not married may occur 200 times. I can manually calculate it using an IF statement, but if the set of combinations becomes really large, this becomes very time-consuming. Is there perhaps an easier solution to this?
Cheers.
Related Posts with Analysis on subset of dataset and aggregation
Simulating the Dickey Fuller distribution in StataDear all, Hope you are all well. Can I ask if there is a way of simulating the Dickey Fuller distr…
How to group connected dates?I have a panel containing daily data which are not all continuous. Within an ID, if those dates are …
Modifying dataset for relative time modelArray Array Array Array P.S. To express notation correctly, I uploaded the screenshot of my post. …
stuck with nested loopsI am trying to select 10 controls per case (using risk-set sampling) matched by general practice. I …
datetime of march 31, 2012Dear All, I have this data set Code: * Example generated by -dataex-. To install: ssc install datae…
Subscribe to:
Post Comments (Atom)
0 Response to Analysis on subset of dataset and aggregation
Post a Comment