Dear all,
In one of my current paper, I have to calculate the relative deprivation measure by comparing the income of individual i (y) with income of each other individuals in the data (m) and report the following:
D(y;m)= m-y if m>y (e.g., there is income deprivation)
0 if m<y (e.g., no relative income deprivation)
Then I have to weight D by the cumulative proportion of total income at income y, and by the cumulative proportion of the population up to individual with income y, where the population is ranked by income. I have tried to go through the notes of the command "mdepriv" and applied it various of times with no success (please see below). I was thinking maybe to create a dummy variable of deprivation but then it would not calculate the m-y needed for my analysis.
When I run the mdepriv code as follows
I keep reciving this error code:
foreach block in "infinc" {qui mdepriv `block´ , method(bv) generate(s`++i´)}
program error: code follows on the same line as open brace
r(198);
I was thinking creating the code manually but it needs to run for each individual in the data and return value of 0 or m-y?
I would really appericate your help.
Thank you in advance for your understanding.
Regards,
Natasha.
In one of my current paper, I have to calculate the relative deprivation measure by comparing the income of individual i (y) with income of each other individuals in the data (m) and report the following:
D(y;m)= m-y if m>y (e.g., there is income deprivation)
0 if m<y (e.g., no relative income deprivation)
Then I have to weight D by the cumulative proportion of total income at income y, and by the cumulative proportion of the population up to individual with income y, where the population is ranked by income. I have tried to go through the notes of the command "mdepriv" and applied it various of times with no success (please see below). I was thinking maybe to create a dummy variable of deprivation but then it would not calculate the m-y needed for my analysis.
When I run the mdepriv code as follows
Code:
ssc install mdepriv mdepriv (infinc), gen(s) force sum s foreach block in "infinc" {qui mdepriv `block´ , method(bv) generate(s`++i´)}
foreach block in "infinc" {qui mdepriv `block´ , method(bv) generate(s`++i´)}
program error: code follows on the same line as open brace
r(198);
I was thinking creating the code manually but it needs to run for each individual in the data and return value of 0 or m-y?
I would really appericate your help.
Thank you in advance for your understanding.
Regards,
Natasha.
Comment