Hi all,
I have a dataset with individuals as observations. Each individual belongs to one of 25 countries (cntrycode) and one of two years (year; 2007, 2011). For each observation I have income (y). I would like to construct a variable which would be the same as if I did -xtile- for y for each country and year. I tired with bysort cntrycode year: xtile newvar = y, n(4), but xtile is not by-able unfotunately. Any ideas? Thanks.
i
I have a dataset with individuals as observations. Each individual belongs to one of 25 countries (cntrycode) and one of two years (year; 2007, 2011). For each observation I have income (y). I would like to construct a variable which would be the same as if I did -xtile- for y for each country and year. I tired with bysort cntrycode year: xtile newvar = y, n(4), but xtile is not by-able unfotunately. Any ideas? Thanks.
i
Comment