skhiggins / CEQStataPackage

CEQ Stata Package to estimate the impact of taxes and transfers on poverty and inequality following the Commitment to Equity framework. To install directly through Stata: ssc install ceq, replace
5 stars 12 forks source link

ceqef returns "invalid syntax r(198)" error #50

Open StephenDYounger opened 6 years ago

StephenDYounger commented 6 years ago

Output: Running version 1.9 of ceqef on 29 Jun 2018 at 12:56:29 (please report this information if reporting a bug to sean.higgins@ceqinstitute.org and marc.brooks@ceqinstitute

.org) invalid syntax r(198);

Dataset has a variable poverty line which is the likely source of the problem. tab_E9.log

skhiggins commented 6 years ago

Could you run it again with set trace on then scroll up and find which line of code produced the error to help us debug?

StephenDYounger commented 6 years ago

Attached.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 1:20 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Author author@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Could you run it again with set trace on then scroll up and find which line of code produced the error to help us debug?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401419120, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLZ7n4IdjMVT19hDqbOTnLJVWnsFRks5uBmGwgaJpZM4U9VbS.

skhiggins commented 6 years ago

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

  - qui gen `zyzfgt1_3' = max((`_pline'-`vtouse3')/`_pline',0)
  = qui gen __00001R = max((1.9-)/1.9,0)
invalid syntax
StephenDYounger commented 6 years ago

I’m not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the “optimal” tax or benefit. In the case of a variable poverty line, I think you’ll need to order them by their poverty gap for the low end of the distribution. But that won’t work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Author author@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I’m not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the “optimal” tax or benefit. In the case of a variable poverty line, I think you’ll need to order them by their poverty gap for the low end of the distribution. But that won’t work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Author author@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

What about the inequality measures?

Right now, I realize I'm calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I'm not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the "optimal" tax or benefit. In the case of a variable poverty line, I think you'll need to order them by their poverty gap for the low end of the distribution. But that won't work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Author author@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

hmmm, I am a bit confused. Why would we care about the poverty line when we are ordering individuals to calculate the effectiveness indicator for an inequality measure (e.g. Gini)? when I coded my indicators, since proper ordering may differ from one indicator to another, I did not use a global ordering of individuals. Instead, I order individuals based on the indicator that is being calculated (i.e. even if it meant repeating a set of codes several times).

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 3:28 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

What about the inequality measures?

Right now, I realize I’m calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I’m not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the “optimal” tax or benefit. In the case of a variable poverty line, I think you’ll need to order them by their poverty gap for the low end of the distribution. But that won’t work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Author author@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

skhiggins commented 6 years ago

I think I agree with @StephenDYounger here that if there is a variable poverty line, it isn't the absolute poverty gap that matters, it's the relative poverty gap so we should follow an approach like Ravallion's of defining a new income variable that equals income/PL. That's what some of the other commands do but I'm not sure about ceqef since I didn't program that one -- I'll look into it.

More broadly, Ali in your framework you aren't ordering by the poverty gap but rather by the income level, right? If there is a variable poverty line these two options won't give the same ordering.

So a question is whether our current theoretical framework for the effectiveness indicators can accommodate variable poverty lines if we do the income/PL solution.

StephenDYounger commented 6 years ago

Because the income itself has not been scaled by the adult equivalent. Using HH income and the variable poverty line, you get the correct poverty values, but you can't do inequality on HH income; it should be scaled by adult equivalent, too.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 7:22 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

hmmm, I am a bit confused. Why would we care about the poverty line when we are ordering individuals to calculate the effectiveness indicator for an inequality measure (e.g. Gini)? when I coded my indicators, since proper ordering may differ from one indicator to another, I did not use a global ordering of individuals. Instead, I order individuals based on the indicator that is being calculated (i.e. even if it meant repeating a set of codes several times).

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edumailto:aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:28 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

What about the inequality measures?

Right now, I realize I'm calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I'm not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the "optimal" tax or benefit. In the case of a variable poverty line, I think you'll need to order them by their poverty gap for the low end of the distribution. But that won't work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com<mailto:CEQStataPackage@noreply.github.com> Cc: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

The theory should be the same. You can define a fixed poverty line with income per adult equivalent or a variable poverty line that reflects the equivalence scale and compare income alone to that. The results are the same.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 8:43 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Mention mention@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I think I agree with @StephenDYoungerhttps://github.com/StephenDYounger here that if there is a variable poverty line, it isn't the absolute poverty gap that matters, it's the relative poverty gap so we should follow an approach like Ravallion's of defining a new income variable that equals income/PL. That's what some of the other commands do but I'm not sure about ceqef since I didn't program that one -- I'll look into it.

More broadly, Ali in your framework you aren't ordering by the poverty gap but rather by the income level, right? If there is a variable poverty line these two options won't give the same ordering.

So a question is whether our current theoretical framework for the effectiveness indicators can accommodate variable poverty lines if we do the income/PL solution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401505433, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLQ-Kjz6mvXb6ct8os5Yf3x0-N325ks5uBsmHgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

Ok I understand the need for the proper scaling of income for a household in order to get proper per capita or equivalent adult values. This could be for various reasons, such as variation in regional inflation rates or because dividing the total income by the household size reduces the income of big households too much and misleads any estimation based on a simple per capita basis.

I would assume we can incorporate every relevant variable into one scaling factor and scale the per capita (or equivalent adult) values of income, taxes and transfers accordingly. Once we scaled everything, we can proceed with ranking of individuals and the rest of calculations.

Is there a specific complication in calculating this scaling factor (with the exception of agreeing on the relevant variables that should be included in defining such scaling factor)? I feel for every relevant variable, we can define a sub-scaling-factor and then we multiply all of these factors together. For example, a family of four gets a sub-scaling factor for its size and one for its geographic location in the rural/urban areas. The final scaling factor would be the multiplication of these two sub-factors. I guess we can also use the variable poverty line as the scaling factor.

Best WIshes

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 8:33 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Because the income itself has not been scaled by the adult equivalent. Using HH income and the variable poverty line, you get the correct poverty values, but you can’t do inequality on HH income; it should be scaled by adult equivalent, too.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 7:22 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

hmmm, I am a bit confused. Why would we care about the poverty line when we are ordering individuals to calculate the effectiveness indicator for an inequality measure (e.g. Gini)? when I coded my indicators, since proper ordering may differ from one indicator to another, I did not use a global ordering of individuals. Instead, I order individuals based on the indicator that is being calculated (i.e. even if it meant repeating a set of codes several times).

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:28 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

What about the inequality measures?

Right now, I realize I’m calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I’m not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the “optimal” tax or benefit. In the case of a variable poverty line, I think you’ll need to order them by their poverty gap for the low end of the distribution. But that won’t work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com<mailto:CEQStataPackage@noreply.github.com> Cc: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

The immediate problem I have is that I don't know the scale, other than it is complicated, based on a regression, I think. All I have is a variable for the poverty line and total HH income.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 9:52 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Ok I understand the need for the proper scaling of income for a household in order to get proper per capita or equivalent adult values. This could be for various reasons, such as variation in regional inflation rates or because dividing the total income by the household size reduces the income of big households too much and misleads any estimation based on a simple per capita basis.

I would assume we can incorporate every relevant variable into one scaling factor and scale the per capita (or equivalent adult) values of income, taxes and transfers accordingly. Once we scaled everything, we can proceed with ranking of individuals and the rest of calculations.

Is there a specific complication in calculating this scaling factor (with the exception of agreeing on the relevant variables that should be included in defining such scaling factor)? I feel for every relevant variable, we can define a sub-scaling-factor and then we multiply all of these factors together. For example, a family of four gets a sub-scaling factor for its size and one for its geographic location in the rural/urban areas. The final scaling factor would be the multiplication of these two sub-factors. I guess we can also use the variable poverty line as the scaling factor.

Best WIshes

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edumailto:aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 8:33 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Because the income itself has not been scaled by the adult equivalent. Using HH income and the variable poverty line, you get the correct poverty values, but you can't do inequality on HH income; it should be scaled by adult equivalent, too.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 7:22 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

hmmm, I am a bit confused. Why would we care about the poverty line when we are ordering individuals to calculate the effectiveness indicator for an inequality measure (e.g. Gini)? when I coded my indicators, since proper ordering may differ from one indicator to another, I did not use a global ordering of individuals. Instead, I order individuals based on the indicator that is being calculated (i.e. even if it meant repeating a set of codes several times).

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:28 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

What about the inequality measures?

Right now, I realize I'm calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I'm not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the "optimal" tax or benefit. In the case of a variable poverty line, I think you'll need to order them by their poverty gap for the low end of the distribution. But that won't work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com<mailto:CEQStataPackage@noreply.github.com> Cc: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

StephenDYounger commented 6 years ago

Here is my suggestion about scaling when we only want to incorporate poverty line in it through an example (values of the variable poverty line are assumed given):

HH income (A)

HH size (B)

Unscaled Per capita income (C=A/B)

Per capita poverty line (based on the HH size) (D)

Scale (E=D/min(D))

Scaled Per capita income (F=C/E)

1000

10

100

3

1 (3/3)

100/1

1000

4

250

3.6

1.2 (3.6/3)

250/1.2

1000

2

500

3.9

1.3 (3.9/3)

500/1.3

1000

1

1000

4

1.33 (4/3)

1000/1.33

The assumption is that whatever factor that derives a variable poverty line (here the size of household), also determines the relative real value of each household income.

Let me know your thoughts about this way of scaling per capita income.

Best Wishes

Ali


Ali Enami PhD Candidate Department of Economics Tulane University aenami@tulane.edu www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu Sent: Friday, June 29, 2018 9:19 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

The immediate problem I have is that I don’t know the scale, other than it is complicated, based on a regression, I think. All I have is a variable for the poverty line and total HH income.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 9:52 PM To: Stephen D. Younger stephen.d.younger@cornell.edu; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Ok I understand the need for the proper scaling of income for a household in order to get proper per capita or equivalent adult values. This could be for various reasons, such as variation in regional inflation rates or because dividing the total income by the household size reduces the income of big households too much and misleads any estimation based on a simple per capita basis.

I would assume we can incorporate every relevant variable into one scaling factor and scale the per capita (or equivalent adult) values of income, taxes and transfers accordingly. Once we scaled everything, we can proceed with ranking of individuals and the rest of calculations.

Is there a specific complication in calculating this scaling factor (with the exception of agreeing on the relevant variables that should be included in defining such scaling factor)? I feel for every relevant variable, we can define a sub-scaling-factor and then we multiply all of these factors together. For example, a family of four gets a sub-scaling factor for its size and one for its geographic location in the rural/urban areas. The final scaling factor would be the multiplication of these two sub-factors. I guess we can also use the variable poverty line as the scaling factor.

Best WIshes

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 8:33 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Because the income itself has not been scaled by the adult equivalent. Using HH income and the variable poverty line, you get the correct poverty values, but you can’t do inequality on HH income; it should be scaled by adult equivalent, too.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 7:22 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

hmmm, I am a bit confused. Why would we care about the poverty line when we are ordering individuals to calculate the effectiveness indicator for an inequality measure (e.g. Gini)? when I coded my indicators, since proper ordering may differ from one indicator to another, I did not use a global ordering of individuals. Instead, I order individuals based on the indicator that is being calculated (i.e. even if it meant repeating a set of codes several times).

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:28 PM To: Enami, Ali; skhiggins/CEQStataPackage Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

What about the inequality measures?

Right now, I realize I’m calculating inequality just on a per capita basis, not consistent with the per adult equivalent basis of my poverty calculations.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Enami, Ali [mailto:aenami@tulane.edu] Sent: Friday, June 29, 2018 4:23 PM To: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; skhiggins/CEQStataPackage reply@reply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I am assuming we are talking about an optimal benefit when we are concerned with something like minimizing poverty squared gap right? Then what we really care about is a proper ordering of poor people (the low end of the income distribution) and it doesn't matter how we order the non-poor individuals. Ordering by the poverty gap is how I would go about it and I feel programming wise there would be no real difference between a constant or a variable poverty line.

Ali


Ali Enami

PhD Candidate

Department of Economics

Tulane University

aenami@tulane.edumailto:aenami@tulane.edu

www.alienami.comhttp://www.alienami.com


From: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu> Sent: Friday, June 29, 2018 3:11 PM To: skhiggins/CEQStataPackage Cc: Enami, Ali Subject: RE: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

I’m not sure how your code works for these, but the way I was writing it, and the way Ali did his, I think, is to order households by income when finding the “optimal” tax or benefit. In the case of a variable poverty line, I think you’ll need to order them by their poverty gap for the low end of the distribution. But that won’t work at the top end.

I remember Ravallion writing papers where he used hh income scaled by the poverty line, so a just poor person = 1. That might be the way to go.

Stephen D. Younger

sdy1@cornell.edumailto:sdy1@cornell.edu

Associate Director

Commitment to Equity Institute

Commitmentoequity.org

+1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Friday, June 29, 2018 4:00 PM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com<mailto:CEQStataPackage@noreply.github.com> Cc: Stephen D. Younger stephen.d.younger@cornell.edu<mailto:stephen.d.younger@cornell.edu>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Indeed it looks like an issue with the local macros used to accommodate a variable poverty line; we'll work on fixing this.

invalid syntax

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#issuecomment-401458932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLbRYNzLtH6TY0R7K8GebPWoeS9zKks5uBodMgaJpZM4U9VbS.

skhiggins commented 6 years ago

@StephenDYounger I don't have your Botswana data to replicate your error but I think I pinpointed and fixed the issue. Could you test by installing the development version then rerunning your do file?

net install ceq, from("https://raw.githubusercontent.com/skhiggins/CEQStataPackage/master/") replace
StephenDYounger commented 6 years ago

Hi Sean,

I couldn’t see on GitHub where to add to the thread, so here is the error message I now get:

Running version 1.10 of ceqef on 30 Jun 2018 at 07:41:02 (please report this information if reporting a bug to sean.higgins@ceqinstitute.org and marc.brooks@ceqinstitute

.org) r(9);

Some assertion is false.

Stephen D. Younger sdy1@cornell.edumailto:sdy1@cornell.edu Associate Director Commitment to Equity Institute Commitmentoequity.org +1 607 351 6690 (cell)

From: Sean Higgins [mailto:notifications@github.com] Sent: Saturday, June 30, 2018 3:30 AM To: skhiggins/CEQStataPackage CEQStataPackage@noreply.github.com Cc: Stephen D. Younger stephen.d.younger@cornell.edu; Mention mention@noreply.github.com Subject: Re: [skhiggins/CEQStataPackage] ceqef returns "invalid syntax r(198)" error (#50)

Reopened #50https://github.com/skhiggins/CEQStataPackage/issues/50.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/skhiggins/CEQStataPackage/issues/50#event-1709857121, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjtrLVyKul-WSEjsW3k6SO7zdIvbO2Xvks5uByj4gaJpZM4U9VbS.

skhiggins commented 6 years ago

I looked into this and the assertion error is happening because once we apply the algorithm to figure out how many people to redistribute to in order to get the same ending Gini as observed, and then we check this against the observed ending Gini, they are not the same (within a margin of error).

I am not sure if this is an issue with the algorithm or programming -- as a next step @StephenDYounger or Ali could you run Ali's do file to calculate spending effectiveness with Stephen's data and see if it calculates it correctly? If so, that would indicate that it's an issue with the ceqef code