Code:
egen HHI= sum(ssqrd), by(OCCUPATION time)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float CASTE double(OCCUPATION ssqrd) 6 . . 4 . . 7 . . 1 . . 6 . . 4 . . 3 63 .12891192949776026 3 . . 2 . . 4 98 .04029183669790953 1 43 .005133198245092206 3 . . 3 63 .12891192949776026 3 . . 2 . . 3 . . 3 . . 2 . . 3 . . 3 . . 6 . . 2 . . 4 . . 4 . . 2 . . 2 . . 4 . . 4 . . 6 . . 4 . . 2 . . 4 . . 3 . . 4 . . 2 . . 5 . . 3 . . 3 8 .07321799307958476 3 . . 2 . . 2 63 .00806835999564883 6 52 .01222975778546713 4 53 .09494997295835586 3 15 .06689460346578277 3 63 .13619516038503374 3 . . 3 . . 8 . . 3 . . 4 . . end label values CASTE GROUPS label def GROUPS 1 "Brahmin 1", modify label def GROUPS 2 "Forward caste 2", modify label def GROUPS 3 "OBC 3", modify label def GROUPS 4 "Dalit 4", modify label def GROUPS 5 "Adivasi 5", modify label def GROUPS 6 "Muslim 6", modify label def GROUPS 7 "Christian, Sikh, Jain 7", modify label def GROUPS 8 "Christian, Sikh, Jain 8", modify
0 Response to Creating new variable as the sum of another variable
Post a Comment