Hello,
I want to divide the consumer expenditure variable into quintiles. I have individual-level data, but the expenditure is given at the household level. I'm using the below codes to generate the required variable:
I'm not sure about it because stata is taking too long. Please help.
I want to divide the consumer expenditure variable into quintiles. I have individual-level data, but the expenditure is given at the household level. I'm using the below codes to generate the required variable:
Code:
sort common_id
Code:
egen byte tag = tag(common_id)
Code:
by common_id: egen MCE = xtile(usual_monthly_con_exp) if tag & sector==1, nq(5)
Comment