[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Reza Daniels" <Reza.Daniels@uct.ac.za> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: multiple lorenz curves with glcurve |

Date |
Mon, 27 Aug 2007 12:02:04 +0200 |

Dear Statalisters, I am setting an undergraduate assignment for development economics that uses Microsoft Excel to compute poverty lines and draw lorenz curves. I would like to do the same using Stata, but I'm having trouble with -glcurve- when I try and simultaneously graph three separate measures for income. Here is the code I've used: *** BEGIN CODE *** clear cd "C:\Documents and Settings\Administrator\My Documents\Teaching\2007\eco2008s" log using "assgt1.smcl",replace version 8.2 set more off set obs 30 gen obsno=_n gen gender=. replace gender=1 in 1/15 replace gender=2 in 16/30 set seed 135791113 gen z1=9+invnorm(uniform()) gen income=round(exp(z1)) di 365*7 /* 2555 = World Bank annual $1/day povline in local currency */ di 800*12 /* 9600 - SA Treasury monthly povline */ povdeco income,pl(2555) /* Poverty */ povdeco income,pl(9600) sumdist income inequal income gen inc2=1200+income /* Basic income grant */ povdeco inc2,pl(9600) sumdist inc2 inequal inc2 gen inc3=. /* Progressive income tax */ su income,det replace inc3=income*0.9 if income<=r(p25) replace inc3=income*0.8 if income>r(p25) & income<=r(p50) replace inc3=income*0.7 if income>r(p50) & income<=r(p75) replace inc3=income*0.6 if income>r(p75) povdeco inc3,pl(2555) povdeco inc3,pl(9600) ** BREAK *** Now I'd like to compare the three Lorenz Curves for income, inc2 & inc3. I'm using the following code: * CODE STARTS AGAIN *** glcurve income,gl(g1) p(p1) nograph glcurve inc2,gl(g2) p(p2) nograph glcurve inc3,gl(g3) p(p3) nograph twoway (line g1 p1) (line g2 p2) (line g3 p3) *** END CODE *** When I use this code, I get the cumulative population on the x-axis but it looks like I'm getting actual income (rather than cumulative) on the y-axis. My question is: (1) How do I change this to plot the three measures simulataneously? (2) How do I include the 45 degree line on the graph? Many thanks, Reza * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: Sort order in graph box, over() by()** - Next by Date:
**st: Editor with Autoit - now also running from start to cursor position** - Previous by thread:
**st: Sort order in graph box, over() by()** - Next by thread:
**RE:st: multiple lorenz curves with glcurve** - Index(es):

© Copyright 1996–2014 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |