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
Calculating dummies based on other variablesDear specialists, I have a panel data, it includes Stock ID (Stkcd), fiscal year (Year), Background…
How to convert a single column into multiple rowsHi there, A newbie here. I have been trying to convert my data for hours but could not manage to do …
Mlogit with Multiple Imputation Produces Relative Risk Ratios with Negative ValuesI am analyzing summarized Medicaid data (N = 1,102,479) and using Stata 17.0. I am looking at variou…
Axis titles bleeding into plot areaHello! First time poster, thank you all for your helpful advice in the past. And apologies if this i…
The Im, Pesaran and Shin (IPS) Unit Root TestWhen conducting the IPS unit root test, the options that you can add to the command include "trend",…
Subscribe to:
Post Comments (Atom)
0 Response to Analysis on subset of dataset and aggregation
Post a Comment