World Bank Development Research Center Discussion Papers No. 26 Income D i s t r i b u t i o n Within G r o u ? ~ , Among Groups, and Overall: A Technique of Analysis Sherman Robinson KOTE: Discussion Papers a r e p r e l i n i n a r y materials c i r c u l a t e d t o s t i m u l a t e - - discussion and c r i t i c a l comment. Refereaces i n publication to Discussion Papers should be cleared with the zuthor(s) t o p r o t e c t '% - the teiitative c h a r a c t e r of these papers. The papers express t h e views of the author and should not be i n t e r p r e t e d t o r e f l e c t those a* . of t h e World Bank. 8 Income D i s t r i b u t i o n Within Groups, Among Groups, and O v e r a l l : A Technique of Analysis Sherman Robinson Research Program i n Development S t u d i e s Woodrow Wilson School P r i n c e t o n U n i v e r s i t y P r i n c e t o n , New J e r s e y August, 1976 C i s c u s s i o n Paper No. 65 F i n a n c i a l s u p p o r t f o r t h i s work was provided by t h e World Bank through t h e Develop- ment Research Center and t h e Economic Analysis and P r o j e c t i o n s Department. The , Bank does not n e c e s s a r i l y a g r e e w i t h any views expressed i n t h i s paper. L I t T h i s work w a s done a s p a r t of a j o i n t p r o j e c t w i t h I r a a Adelman to1 b u i l d a model of income d i s t r i b u t i o n i n Korea. ?ly thanks t o her and a l s o t o Gregory Chow f o r - I d i s c u s s i o n s and a s s i s t a n c e . - .r -.% r - Note: Giscussion papers of t h e Research Program i n Development S t u d i e s a r e p r e l i a i n a r y x a t e r i a l c i r c u l a t e d t o s t i n u l a t e d i s c u s s i o n and c r i t i c a l c o m e n t . P l e a s e do not r e f e r t o d i s c u s s i o n papers L,-ithout permission of t h e a u t h o r . I 11. Aggregating Group Distributions 111. Distribution Statistics Yezn and Variance of Income Quantiles-nf t h e D i s t r F ! . ~ t i o n Yean Incomes of Quantiles Lorenz Curve and Gini Coefficient Other D i s t r i b u t i o n S t a t i s t i c s I V . Conclusion Appendices A. User's Guide t o t h e Income D i s t r i b u t i o n Program 16 Szmple Output B. Programmer's Guide C. Program L i s t i n g I. Introduction The pur7ose of t h i s paper is t o describe a technique and an associated computer algorithm f o r deriving t h e o v e r a l l d i s t r i b u t i o n of incone ( t h e s i z e d i s t r i b u t i o n ) given d a t a on the d i s t r i b u t i o n otf income +etween and within aggregate groups i n t h e economy. I n p a r t i c u ~ l a r ,t h e - technique can be used t o nap from the d i s t r i b u t i o n of income by major f a c t o r s of ?reduction such a s l a b o r , c a p i t a l , and land (the funlctional d i s t r i b u t i o n ) i n t o t h e o v e r a l l s i z e d i s t r i b u t i o n . It can also be used with o t h e r group d e f i n i t i o n s such a s by regions, s e c t o r of productialn, o r socioecononic categories. Any convenient d e f i - l i t i o n s of groups w i l l do so long a s they a r e complete and mutually exclusive. The technique was developed f o r an economy-wide model of income d i s t r i b u t i o n i n Korea and has a l s o been applied i n a very d i f f e r e n t model of socio- economic mobility and income d i s t r i b u t i o n . See Adelmaln and Robinson (1976) and Robinson and Dervis (1974). Related approa,ches have been used by o t h e r s -- s e e Rodgers, Hopkins and W6ry (1976) and Thorbecke and Sengupta (1972). The approach is c l e a r l y useful. i n economic models s i n c e i t provides a way t o take d a t a economy-wide models usually generate such a s f a c t o r incomes and, with some a d d i t i o n a l information, generate t h e o v e r a l l tncone d i s t r i b u t i o n . 0 I n a d d i t i o n t o its usefulness i n models, the basic a~pproach should a l s o be very useful i n t h e preparation of income d i s t r i b u t i o n data f o r a country. I t provides a framework within which one can incegrate - iccome d i s t r i b u t i o n data from a numbel of d i f f e r e n t sources i n order t o generate the o v e r a l l d i s t r i b u t i o n . Using t h i s technique, one can divide t h e ecsnoxy i n t o any convenient complete s e t of d i s p a r a t e groups and then use d a t a on each s e p a r a t e group t o determine i t s within- group d i s t r i b u t i o n . The d a t a sources used t o analyze each separate group might be e n t i r e l y d i f f e r e n t . For example, one n i g h t use a g r i c u l t u r a l surveys f o r r u r a l groups, household surveys f o r urban workers, t a x d a t a f o r t h e r i c h , and s o f o r t h . National accounts o r input- output d a t a can be used t o analyze t h e between-group d i s t r i b u t i o n and then t h e algorithm can be used t o generate t h e o v e r a l l s i z e d i s t r i b u t i o n . It thus can provide a method for reconciling income d i s t r i b u t i o n d a t a from a number of d i f f e r e n t sources. 11. Aggreqz f&i& Group D i s t r i b u t i o n s The technique c o n s i s t J s i a p l y o f numerically aggregating a n m 5 e r of d i f f e r e n t within- group income d i s t r i b u t i o n s whose f u n c t i o n a l form and parameters a r e known. The r e s u l t i n g a g g r e g a t e d i s t r i b u t i o n i s thus coz- p l e t e l y s p e c i f i e d n u m e r i c a l l y , even though it may n o t be a b l e t o be des- c r i b e d by any convenient sunmary d i s t r i b u t i o n function. A l l s t a t i s t i c s of t h e a g g r e g a t e d i s t r i b u t i o n c a n be generated n m e r i c a l l y . Assune t h a t t h e r e a r e n d i f f e r e n t groups and t h a t t h e d i s t r i b u t i o n of income w i t h i n each group is given by t h e p r o b a b i l i t y distrlbut.ion f u n c t i o n : where 8 is a vector of parameters for each distribution and f r e f l e c t s i i t h e f u n c t i o n a l form f o r t h e d i s t r i b u t i o n -&thin group i (such a s lognormal, P a r e t o , e t c . ) . The o v e r a l l d i s t r i b u t i o n of income is given by: n where t h e weight wi is t h e population s h a r e of group i and 0 is t h e s e t of a l l p a r a x e t e r s 9 = 1, t h e i f o r a l l I. Note t h a t s i n c e 0 G wi < 1 and L wi - - f u n c t i o n f ( y j 8 ) is indeed a roba ability d i s t r i b c t i o n f u n c t i o n . It is simply t h e weighted average of t h e s e F a r a t e within- group f u n c t i o n s . Note a l s o t h a t s i n c e f ( y ( 8 ) is a sum of d i s t r i b u t i o n s and not t h e d i s t r i b u t i o n of a suin of random v a r i a b l e s , c e n t r a l l-inlit theorems do not apply. 'The d i s t r i b u t i o n f(yjO) may i n p r i n c i p a l have any shape and be co~mpletely Given complete knowledge of w - and 9 i i' one can g e n e r a t e t h e o v e r a l l d i s t r i b u t i o n !a numerically. f (y h%ile any s t a t i s t i c s f o r t h e o v e r a l l d i s t r i S u t i o n a r e c l e a r l y a funccion o f t h e paraneter s e t 2 and t h e population s h a r e s , -di, i t i s p o s s i b l e t o g e n e r a t e then nuxeric'11ly without a t t e m p t i n g t o d e a l a n a l y t i c a i l y w i t h t h e c v e r a l l d i s t r i b u t i o n f u n c t i o n . 111. D i s t r i b u t i o n S t a t i s t i c s ?lsan and Variance of Incone Assume t h a t t h e mean income of each group is g i v e n by 7i. Then t h e o v e r a l l mean income is: 2 The o v e r a l l v a r i a n c e o f income, s , can be c a l c u l a t e d from t h e decomposition of v a r i a n c e f o r n u l a: 7 where s- i s ' t h e v a r i a n c e o f incomes w i t h i n group i (assuming if:is f i n i t e ) . i The v a r i a n c e of t h e logarithrns o f income is a commonly used i n e q u a l i t y measure and is e s p e c i a l l y i n t e r e s t i n g under t h e assumption o f l o g n o r m a l i t y s i n c e it i s c n e of t h e parameters of t h e distribut:ion. Denote t h e tvo paraixeter lognormal cumulative d i s t r i b u t i o n f u n c t i o n f o r group i a s 7 , . Under t h e l o g n o r x a l d i s t r i b u t i o n , t h a v a r i a b l e x = l o g y is and v a r i a n c e o : ~ ( x l o~2'I. Note t h a t 2 d i s t r i b u t e d normally with mean i i i ' i' i n t h i s c a s e : b when y is d i s t r i b u t e d lognorinally, the within- group mean and v a r i a n c e a r e - - given by :3 - 2 'i -- i ( 4 ) yi = hi + 1/2 oil - (JI) - 3 E 7 J . (5) s2 = [ex? (2 ii [ u p 11 i + 0-i11 3 ~ e ei c c h i s o n and S r o m ( 1 9 5 7 ) , p. 8. For t h e lognormal d i s t r i b u t i o n , t h e q u a n t i l e s are e a s i l y c a l c u l a t e d from t h s ncma? Z i s t r i b u t i o n . Define qi a s t h e k ' t h q u a n t i l e f o r group i k where group i h a s a within- group d i s t r i b u t i o n which is lognormal. Define a s t h e s h a r e of t h e d e n s i t y a s s o c i a t e d w i t h t h e c h o i c e of q u a n t i l e ( s a y , ?:, a l l e q u a l 0 . 1 f o r d e c i l e s ) . The group q u a n t i l e s can be d e f i n e d i t e r a t i v e l y a s: i where = 0 . By a simple change of v a r i a b l e , t h e s e q u a n t i l e s can be 0 i expressed i n terms of t h e normal d i s t r i b u t i o n . Let x = l o g y and .\i = l o g qk. Then and xi = 4. Equation (9) is e a s i l y s o l v e d f o r t h e q u a n t i l e s u s i n g s t a n d a r d 0 a l g o r i t h s f o r c a l c u l a t i n g t h e i n v e r s e n o r m 1 i n t e g r a l . The q u a n t i l e s of t h e o v e r a l l d i s t r i b u t i o n , however, a r e n o t so e a s i l y c a l c u l a t e d . It is necessary to solve the following equation for qk given q. and p A-1 k' where q = 0 . %ere is c e r t a i n l y no simple r e l a t i o n s h i p between q and o -5 k - L the corresponding within- group quant t l e s qi - Yo t e , however, t h a t given k ' and q i t 7 s easy to u s e e q u a t i c n (10) t o s o l v e f o r p by s i s p i y qk-1 k ' k sunning t h e population s h a r e s w i t h i n each group betneen t h e two incor.es. Equation (10) can be w r i t t e n a s a non-linear algebraic equa"tion i n qk : which can be evaluated and whose root we seek. This equation can be solved by a number of d i f f e r e n t techniques. I n t h e computer program described i n t h t appendix, a v a r i a n t of ?;ewtonls method is used i n which t h e d e r i v a t i v e 4 of Q(q ) is calculated nunericaily. An i n i t i a l guess f o r qk i.s calculated k by taking t h e weigilied geometric mean of t h e correspocding T*li~hin-group has quant i l e s, 9:. The techniq~~c/alwaysconverged within 5-16 i t e r a t i o n s . Yean Incomes of Quantiles For both the within- group arid o v e r a l l d i s t r i b u t i o n s , i t i s i n t e r e s t i n g t o know the mean income of people f a l l i n g within given incone ranges -- f o r example, the nean inccme of those i n the lowest d e c i l e . Specify two incomes qk-1 and qk corresponding to some quantile of the o v e r a l l d i s t r i b u t i o n . The mean income of those people whose income f a l l s within the Yange qk-1 -< y 5 qk is simply the weighted average of the corresponding mean incomes of those within each group whose incomes a r e i n the same range. Define the nean income of people within some quantile of the o v e r a l l d i s t r i b u t i o n a s : . I k 1 (12) = - 14 Y~ ( ~ 1 6dy) - Pk qk-1- * where q = 0 , and p is the share of the d e n s a y defined by the quantll? 0 k range: 4 See J a r r a t t (1970) f o r a survey of the techniques available f o r solving such equations. S i n i l a r l y , f o r each group: :here qk-1 and qk d e f i n e a q u a n t i l e of t h e o v e r a l l d i . s t r i b u r i o n , q = 0 0 and - It follows from the definition of f (y13) that: 7 Thus, t o c a l c u l a t e t h e nean incomes of t h o s e f a l l i n g w i t h i n a s p e c i f i e d q u a n t i l e of t h e o v e r a l l d i s t r i b u t i o n defined by q and q one n u s t k-1 k ' c a l c u l a t e t h e mean income of t h o s e i n each subgroup who f a l l w i t h i n t h e same range. For a lognormal d i s t r i b u t i o n , i t is possib1.e t o s o l v e f o r -,i Ic. a n a l y t i c a l l y . Equation (14) becomes: qg = 9, and: L 2 (18) rqk dh(ylui, ai) Pk qk-1 - T h i s i n t e g r a l can be solved i n t e r n s of t h e normal i n t e g r a l . .Gqnange v:.riab i x x = l o g y , y = e - !e 1 - and dx'= (-) dy, dy = y dx Y 10. Fron t h e d e f i n i t i o n o f t h e lognormal d i s t r i b u t i o n ; equation (18) becomes: Equation (17) can a l s o be w r i t t e n i n terms o f t h e normal d i s t r i - bution. Again, from t h e d z f i n i t i o c cf t h e lognormal d i s t r i b u t i o n . .L L X u l t i p l y b o t h s i d e s by y , i n t e g r a t e between qk-1 and qk change v a r i a b l e s - ' X on t h e r i g h t hand s i d e , and n o t e t h a t y e . The r e s u l t is: 7. 2 1 exp [x - - x'Ui 1 1qk y dA(ylui, ail = -l"kx (7] ) 2 d n qk-1 G i r n k-1 2 i Consider t h e term being exponentlated, exp [-I. Multiply i t o u t and complete t h e square. The term becomes: Note t h a t t h e second t e r n does not involve x and can be f a c t o r e d o u t of t h e i n t e g r a l . Furthermore, from e q u a t i o n ( 4 ) : exp (;I + -1 a2) :=-y Thus 1 2 1 i' t h e i n t e g r a l can be w r i t t e n : 7 1 x-(" + 2 exp C- - [ 2 a I I dx L i The i n t e g r a l can be seen t o be a normal i n t e g r a l f o r a v a r i a b l e w i t h mean 2 (ui + u 2) and v a r i a n c e a Thus, t h e quant i l e mean i n equation (17) e q u a l s : i i' If the with2=-src~pdiatributiocs are lognormal, equation (20) m' can be used t o c a l c u l a t e t h e nean income of those with incones i n a s p e c i f i e d range f o r each group. Equation (16) can then be used c a l c u l a t e t h e mean income of those with incomes i n t h e s p e c i f i e d range f o r t h e o v e r a l l d i s t r i b u t i o n . This is t h e method used i n t h e conputer program described i n t h e appendix. - - Lorenz Cur-~eand Gini C o e f f i c i e n t A comon way t o present income d i s t r i b u t i o n d a t a is t o ? l o t t h e proportion of income r e c e i v e r s having income l e s s than y along t h e h o r i z o n t a l a x i s ( t h i s is t h e cumulative d i s t r i b u t i o n function) a g a i n s t :he pr2portion of t o t a l income going t o t h e same incone r e c e i v e r s on t h e v e r t i c a l a x i s . The r e s u l t i n g graph is a Lorenz curve, an example of which is given below Lorenz Diagram 1.0 9: of income C . I of population . I t h e d i s t r i b u t i o n of income is p e r f e c t l y equal, t h e Lorenz 'J - curve is t h e diagonal s t r a i g h t l i n e . The nore unequal is t h e d i s t r i b u t i o n ,- - the&ore t h e curve bows out from t h e diagonal and the g r e a t e r is the shadpd I area. The Gini c o e f f i c i e n t is a measure of incone i n e q u a l i t y based on t h e Lorenz curve and i d equal t o t h e r a t i o of the sbaded a r e a t o t h e area of t h e t r i a n g l e under t h e diagonal. Formally, f o r t h e o v e r a l l d i s t r i - 5 b u t i o n , t h e d e f i n i t i o n of t h e measure is: where: (2 2) P(y) = 1; f ( t l 5 ) d t , and F(y) is s i a p l y the cumulative d i s t r i b u t i o n f u n c t i o n . Given t h a t one can c a l c u l a t e the nean income of people f a l l i n g w i t h i n any income range, then it is s t r a i g h t f o r ~ a r dt o c a l c u l a t e Q(y) n u n e r i c a l l y . Compare e q u a t i o n s (12) and (23). The Lorenz diagram simply p l o t s Q(y) on t h e v e r t i c a l a x i s a g a i n s t F{y) on t h e h o r i z o n t a l a x i s . For t h e within- group d i s t r i b u t i o n s , which a r e assuned t o be log- normal, t h e G i n i c o e f f i c i e n t s can be d e r i v e d a n a l y t i c a l l y . They a r e given 6 by: For t h e o v e r a l l d i s t r i b u t i o n , e q u a t i o n (21) n u s t b e evaluated . C t numerically. In t h e computer program p r e s e n t e d i n t h e appendices, tho c a l c u l a t i o n is done i n t h e following s t e p s . - - F i r s t , c a l c u l a t e q u a n t i l e s ( ~ s u a l l yd e c i l e s ) of t h e o v e r a l l d i a r i b u t i o n and t h e corresponding incones q p Second, c a l c u l a t e t h e z a n incomes of people fall.ing w i t h i n k ' s - 5 ~ e eKendall and S t u a r t ( 1 9 6 3 ) , v a l . 1, 7 p . 45-49, and i i t c h i s o n and Brown (1957), p . 112. 6 ~ e ei i t c h i s o n and Brovn (1957), p . 112. each q u a n t i l e . Third, using, these means, c a l c u l a t e O(qk) f o r a l l t h e qnantiles. The points ~ ( q and) ~ 3(qk) f a l l on t h e Lorenz curve. Since t h e q u a n t i l e s a r e chosen t o contain equal p r o p o r t i ~ n scf t h e population (say, d e c i l e s ) , then t h e points ~ ( q) a;e equally splced k along t h e h o r i z o n t a l a x i s . Fourth, integrate the Lorenz curve nunerically based on t5.e calculated p o i n t s . It is obvious that i f the integration is done by simply con- necting t h e points with s t r a i g h t l i n e s , then t h e degree of i n e q u a 1 i . t ~w i l l underestimated (as t h e diagran below shows) I n t h conputer p r o g r v described i n t h e appendices, the s t r a i g h t l i n e ~ approxixition is not used. Instead, an equal- interval quadrature method c r ' l e d Simpson's r u l e Ls used which f i t s a polynomial curve t o successive 7 s e t s of p o i n t s and then i n t e g r a t e s the f i t t e d curve. The tec'nnique was . 4 r '. t e s t e d by c a l c u l a t i n g the GLni c ~ e f f i c i e n tnumerically f o r a lognormal d i s t r i b u t i o n (based on d e ~ i l e . ~ o I n t and comparing i t with t h e _ v a l ~ e s ) - calculated fron equation ( 2 4 ) . - The values a r e extrenely close,&wit;?in 0 . 5 percent & the a c t u a l value. I 'see Arden and As:ill ( 1 9 i 0 ) , p p . 82-84, Other D i s t r i b u t i o n S t a t i s t i c s ' . - Fro3 t h e previous equations, one can genc.rate empirically a complete d e s c r i p t i o n of a l l t 5 e within- group and o v e r a l l d i s t r i b u t i o n s a l l as v e l l a s anzlyze t h e group cooposition of t h e o v e r / d i s t r i b u t i o n . Using t h i s approach, i t is i n t e r e s t i n g t o c a l c u l a t e t h e composition by groups of q u a n t i l e s of t h e o v e r a l l d i s t r i b u t i o n -- f o r example, t h e s'nare of t h e people i n t h e bottom d e c i l e who a r e r u r a l . It is also interesting to a l l analyze t h e s h a r e of p a r t i c u l a r groups i n q u a n t i l e s of t h e o v e r / d i s t r i b u t i o n -- f o r example, tke share of r u r a l workers i n t h e f i r s t d e c i l e of t h e o v e r a l l d i s t r i b u t i o n . Given t h a t t h e d i s t r i b u t i o n can be generated empirically, it is easy t o compute any aggreEate measures of inequality based on it. A number of d i f f e r e n t measures have been used, generally based e i t h e r on t h e frequency Function o r on t h e Lorenz curve. For a survey of such neasures, s e e Sen (1973) o r Szal and Robinson (1977). Certain aggregate s t a t i s t i c s can be decomposed i n t o within- group and between-group contri- butions. Equations (3) and (7) provide such a decoaposition f o r the variance and l o g variance. Decompositions have a l s o been devised Eor t h e o u o U 3 C D C -d -d 0 !-I r( 4 U U 4 V ) r ( rd .d c !-I a a, w 3 ' d a o z a C r d h -4 a .-I I c a o -r( a 3 ( d D U U (d U -d !-I c r d u h h a , o ! - I c U D U + M a , m u w ! - I U U a , c c w 2 r c w W v-4 !-I -u a l o s w w 0 a, JJ M V) c 'd H a , ? &J 0 (d !-I !-I M a, d C ry a d ta .c U Appendix X User's Guide t o t h e Income D i s t r i b u t i o n Program This appendix describes hov t o use t h e program t o aggregate a s e t of within- group incose d i s t r i b u t i o n s . The program r e q u i r e s a s input some c o n t r o l parameters; group names and a heading f o r l a b e l l i n g t h e out- p u t ; and d a t a on t h e population, mean income, and l o g variance f o r a l l t h e groups. I n a d d i t i o n , t h e user may s p e c i f y a s e t of absolute income ranges which w i l l be used t o generate an a n a l y s i s of t h e within- group and o v e r a l l d i s t r i b u t i o n s i n the s p e c i f i e d ranges. The input d a t a f o r each job a r e su~rmarizedi n t h e following t a b l e , followed by a d e t a i l e d discussion. A s many jobs a s desired s a y be done i n t h e same run by simply including a s many s e t s of parameter cards a s d e s i r e d , one f o r each run. After t h e l a s t s e t of parameter c a r d s , t h e user must. include one card with t h e word END i n columns 1-3. Input Data f o r Each Job Number of cards Variable Format 1 HDC, A80 1 XG, NQ, NCL, NCOD; 413 e NG/ 8 .YNXNE 8A10 XG Y , u2, w 3F10.0 1 YCLS 4F10.0 HDG: a heading which w i U . be printed a t the top of each page of output. * It can be up to 80 Characters long (1 card). It must not have - EXD a s the f i r s t t h r e e characters. SG: Susber of groups. Xust b e less than 34. SQ: S u b e r of q u a n t i l e s desired. Usually set t o 10 ( d e c i l e s ) . X s e p a r a t e a n a l y s i s of t h e t o p f i v e p e r c e n t and one T e r c e a t of t h e d i s t r i b u t i o n w i l l 5e generated i n any c a s e . 9CL: Nunber of s p e c i f i e d income ranges f o r s e p a r a t e a n a l y s i s . I f NCL > 1, then t h e u s e r must p r o v i d e NCL - 1 values of YCLS to define the income - ranges. I f NCL -< 1, t h e n no v a l u e s of YCLS w i l l be r e a d and t h e YCLS c a r d s u s t be o m i t t e d . Note t h a t i t r e q u i r e s SCL - 1 incomes t o d e f i n e NCL q u a n t i l e r.=nqes. The bottom range is assumed t o be from z e r o t o t h e f i r s t v a l u e of YCLS and t h e top range i s from t h e l a s t v a l u e of YCLS t o infinity. NCL must be less t h a n o r e q u a l t o 5 . NCODE: An i n t s g e r code i x d i c a t i n g t h e form i n which t h e l o g v a r i z n c e s - a r e t o be r e a d i n . I f XCODE 1, the log standard deviations, I f HCODE = 0, then t h e l o g v a r i a n c e s , a , 2 a , must be provided. must be provided. XNAM: Group n a n e r , up t o 10 c h a r a c t e r s each. NG such names niust be provided and w i l l be r e a d i n 8 names per c a r d , using as many c a r d s as necessary. Y : Xean income f o r each group. J ~ :Log v a r i a n c e f o r each group. I f NCODE = 1, t h e log s t a n d a r d d e v i a t i o n u , must be g r o - ~ i d e di n s t e a d . , t v : The p o p u l a t i o n s h a r e s of each group. I f d e s i r e d , t h e a b s o l u t e p o p u l a t i o n s - - may be provided 1;lstead -- t h e program v i l i a.$tonatically riormalize t h e - s h a r e s s o they sum t o one. -- i 4, c Z , w : One c a r d f o r each grodp (format 3 ~ 1 0 . 0 r NG c a r d s i n a l l . ?CLS: NCL - ? v a l u e s of incoxe t o d e f i n e SCL income ranges. I f SCL < 1,- t h i s card n u s t be o m i t t e d . To r u n m u l t i p l e j o b s i n 6 s i n g l e r u n , s h p l y s t a c k a s nany s e t s of 2arameter c a r d s a s d e s i r e d , one f o r each run. A t t h e end of t h e l a s t s e t of p a r a n e t e t c a r d s , t h e u s e r must add one c a r d w i t h the word E h i i n t h e f i r s t t h r e e colunns. The i n p u t c a r d s f o r a sample program a r e l i s t e d below followed by a l i s t i n g of t h e o u t p t from t h e progran. S a l E ~ l eJob TEST RLX FOR DISTRIBUTION P R O G M 8/9/76 3 1 0 4 0 RICH XIDDLE POOR 1000. 0.45 15.0 300. 0.32 35.0 90. 0.50 50.0 50.0 200.0 800.0 END . . . . ODroN m n n ... r o o m 0 O P N 0 0 0 0 C OOO, 0 P O Q VI? n N N N N N L n o - r o m N r o a7 c a m a * . ro u1 \O C C P . . * . me415 w - a * N w a r ul a * . C PINN C C P 0 0 0 0 0 0 0 0 0 3.39 o m m o m - ... . m m a \D N U N N W r n N Ln m - m a o m N P m a - N Q I - f N rues y s m a YI V I U l. vl M J el w T. 2 H tl r. Dl H V r l U o I I = z W H l2 & O H b U E D Z < 4 Z = V H Z 4 H c J 0 mw m 4 = ' u a 4 U H 0 L- t 2 : ' % . + W - 4 - 4 0 J n m - - I - P W O W U b H a [S " m m V 'A z H U W . . a Z W W O U U 0 00 H U H b * z U u 4 PERCEllT CCflP0SITIOU DT GROUPS IB QOANTILES OF OVERALL LISTRIDUTIOU c o L u n y s s o 3 TO O N E H U S D R E O RCY 4 IS INCORES OP QUAYTILLS - 0 1 10.00 PLRCEllI C0I.U EH 1 2 3 0 5 6 B CY 1 .S I CH 0.00 0.01 0.04 0.21 0 -01 2.39 2 KIDDLB 0.15 1.4 2 6.03 18.07 39.42 61.82 3 POOR 99.85 98.57 93.93 81.72 59.77 35.79 4 OVERALL 38.63 58 - 2 6 81.55 112.48 154.24 209.53 I'ZRCEHT DXSTRXBUTIOB O F GROOP5 Ill QUAYTILES OF OVERALL DISTSIBUTIOU PCUS SUE TO ONE RUll CBLD COLUEI 1 2 3 4 5 . 6 ROY 1 RICH 0.00 0 .OO 0.03 0.14 0.54 1.59 2 3IDDLP 0.04 0.41 1.72 5.16 11.26 17.66 3 ~ O O B 19.97 1 9 - 3 1 18.79 16.34 11.95 7.1 6 3 n N C i x : ' 1 4 0 * U ~ ~ O U " U O W 7 . &,I-< > w L-l % 7. 0 .4 L1 W Z L U U L .? < c: Lr. 0 ur =: ..J ht n, z L- 5 c. Z I: 3 J v 3 V C rr. TEST BUY POR D I S T R I B U T X C N PHOC6AM 8/9/76 P A G E U 3 VeRALi I N C O t l E D I S T E I B U ' Z I C I TBCONE INTERVALS A B E 26.93 I N UNITS OF 1 . FREQUENCIES APE I N PERCEKT S ~ ~ Y O LIS AC T UAL CISTRIDUTICI S I R B O L I I S ES'XIH3TED D I S ' L R I B C I I O I A S S U t l I Y C LOGYORHAL D I S T B I B U T I O Y WITH I l O = 5.06764 ALD SIGMA = 1 . 1 1 1 1 0 P C C PI TEST RUN FOE DXSTRILJTICN PROCSAR 8/*;/71 PAGE 6 KEAN INCOMES O P C R O U P S I N Q U A N T I L E RANGES COAtflI!.k! I N C O M E S A B E G I V E N 1 Y F I N A L RCY COLU M Y 1 2 3 - 4 R C Y 1 R I C H 43.55 160.05 516.8s 1499.21 2 Y I C D L E lr2.87 1lr3.97 356.61 1006.09 3 ~ o o n 33. 58 97.10 282.47 972.69 P O V E R A L L 33.62 110.26 383 .7!i 1lr52.71 P E S C E N T B A B E S 02 GROUPS IR Q U A N l I L f R A b G I S Q U A U T I L EIncones ARE GIFEII 11 P T N A L R C Y C O L U ~ N 1 2 3 4 B C Y 1 A I C?1 0.00 1.95 48.16 lr3.89 2 n1 DDLE 0.20 33.02 64 ,60 2. 19 3 P 3 0 B ' 31.6tl 61.45 6.88 0.03 4 OVERALL 15.89 42.58 . 33.27 8.26 PERCEUT C O R P O S I T I O N OP G U A I T I L E S BY GRCUPS Q U A N T I L I I N C C K E S A R E G I V E N : I FIUAL BOY C O L U ~ N I 2 3 . 4 BCY 1 RICH 0.00 0.69 2 1.71 90.57 2 R I D D L E 0.43 27- 15 57.95 9.26 3 POCK 99.57 72.17 1 C . 34 0.17 .r O V E R A L L 100.00 100.cC 100.00 100.00 . LI C U A U l I L L S 50.00 200 .OO 800.00 0. qu t 35. t Xouondix B -Y P r o g r a m e r ' s Guide t o t h e Income a i s t r i b u t i o n Program X l i s t i n g of t h e program i s g i v e n i n Appendix C. T n i s appendix d e s c r i b e s :he b a s i c a r c h i t e c t u r e of t h e program. The progrzm c o n s i s t s o f a ?L\IX 2 r c g r a n and t h e f o l l o w i n g subprograms: Group 1: STATS CUSS Group 2: ADDER X.LYQ PAGER CLXDF ?lEYW QUAXL' GIXI XOIt51AL QUAINT2 LVOXY X0RX.I QUANT3 >fATObT SOR.?.? QUAUT4 Group 3 : PLOT &.?CHI TSCXLE PSCALE The Group 1 programs, STATS and CLASS, a r e t h e main d r i v i n g r o u t i n e s f o r t h e progran. STXTS does t h e b a s i c a n a l y s i s o f t:he w i t h i n - group and o v e r a l l d i s t r i b u t i o n s . CLASS does t h e a n a l y s i s of t h e group and o v e r a l l d i s t r i b u t i o n s u s i n g t h e incone r a n g e s s p e c i f i e d i n t h e v e c t o r YCLS. The subprograms i n group 2 a r e t h e main working r o u t i n e s of t h e program. Subroutine PAGER p r i n t s t h e heading a t t h e top o f each page and XriTOLT is a u t i l i t y program f o r p r i n t i n g a matrix. . S u b r o u t i n e NOXWL i s tised ,tot c a l c u l a t e t h e norinal i n t e g r a l and Q -a its inverse. NORAL, and o n l y NORUAL, c a l l s t h e two r o u t i n e s ?;OW11 and NO!V12. Subprogran !:Om1 c a l c u l G t e s t h e s t a n d a r d normal i n t e g r a l and SOR!Y2 c a l c u l a t e s ? L - t h e i n v e r s e i n t e g r a l . S i m i l a r s u b r o u t i n e s a r e u s u a l l y p a r t of t 5 e FORTUX l i b r a r y a t nos t conput ef i n s t a l l a t i o n s . The a p p r o p r i a t e l i b r a r y r o u t i n e s f o r a n 13X 360 and a L.ZVAC 1108 a r e i n d i c a t e d i n s u b r o u t i n e ?iOk!iL. The a l o g r i ~ ? ~used i n ?iOK.fi acd SOXY2 a r e c r u d e and i t would be b e t t e r t o x u s e a l i 5 r a r y r o u t i n e , i f a v a i l a j l e . The s a ~ ~ pir o b l e n was done u s i n g e I3Y l i j r a r y r o u t i c e s . The s u b p r o ~ r a a si n Group 3 a r e used t o p l o t t h e d i s t r i b u t i o n f u n c t i o n and t h e Lorenz c7drve f o r t h e o v e r a l l d i s ~ r i b u t i o n These s u b p r o g r a ~ sa r e o n l y c a l l e d frcm s d b r o u t i n e STXTS (which c a l l s s u b r o u t i n e PLOT twLce). I f no p l o t s a r e d e s i r e d , a l l t h e programs i n Group 3 can - be d e l e t e d and t h e two c a l l s t o PLOT f r o n STATS n u s t a l s o be d e l e t e d . I n t h i c c a s e , t h e parameter IPRINT i n STXlS should be l e s s than 2 t o avoid p r i n t i n g t h e graph headings. I f it is d e s i r e d t o o v e r l a y t h e progran, n o t e t h a t the groups of s u b p r o g r a ~ sa r e h i e r a r c h i c a l . No subprogram i n a h i g h e r numbered group c a l l s a subprogram from a lower numbered group. I n a d d i t i o n , n o t e t h a t t h e Group 3 subprograms a r e . o n l y c a l l e d by s u b r o u t i n e STXTS. Appendix C: Program Listing -- 28. P --- p -- n -9:- 3 3 39IT'TZS BY S H Z R 5 A Y B C B I N S O Y , P S I Y C S T C R U N I V E I i S I : Y , L L "..4L!! 1566 , 2 2 Y I S E D SIM!!ER 1976, ,- -: Yar!: ??oG?AY TO 2ilN STATS, Y H I C H PIAKES UP OVERALL D I S T R I B U T I O Y - F?C)Y. X S S 7 Cr' G 3 3 U P D X S T R I B O T I O ? l S . - 2 1 ? 3 3 5 I C S % B X 3 ( 3 5 ) , X f l 0 ( 3 5 ) , S I G N b ( 3 5 ) , 5 1 ( 3 5 ) , 1 ; i ? : A A E ( 3 5 , 3 ) ,YAZAN ( 3 5 , s ) , ? O P ( 3 5 , 5 ) , Y C L S (5), S S U H ( 3 ) 3ATJ. S S U Y / ' O Y E R ' ,' A L L ,-,,L - ',' '/ ,XEBD/' END'/ C3"?!C)!;/?ASE/ 1I.Y !lAIN, CLASS, HATOOT, PA3EF!,PLOT,QUAHT4, S T A T S p --.- _ -.. 2 3 Y . ? O Y / P A G 3 / YPAGE, N L I H E , HCG (20) ZO,'l.?C!i/)'O?K/ IY !lAI!i, CLASS, GIH18QUAHT3,QUANT4, XNC STA1'S 30E.qOY /WORK/ Y a D , NCD,DUflY (35,20) -- -- I Y ' L I ' Z A L T Z E FIXST ?A52 O? S C T P U T N 2 A G E = 1 '1 3 1 Y 3 Y S I O N . 5 TOE! ilUHTf A ilCfrK AREA Y 3 D = 35 X Z D = 20 C ? O R Z A s D i)3AD25, 0 2 CONV'L4T T O T A P E UNIT ,..7 - 5 7 - J3 = 0 Z ZEAD ONE C A R 3 (UP T O 80 CHARS.) W H I C H M I L L B E A C N E L I Y E ilEADZHG ONC U T ? I 1 0 3 E Z A D ( L F , 1C03) (HDG (I), 1 = 1 , 2 0 ) 1 P O 3 Y A T ( 2 0 A 4 ) .l- (HDG(1) 7 Q XZBD) G O T O 9 9 9 9 J B = J B + 1 12 il ZXD N U Y B E R OIr GROUPS T O B E AGGREGATED, HUHBEP, OC Q U A N T I I , E S , AND - ~ u n a zO ~ F I Y C O ~ ECLAS S ES . i t Z A D ( L R f 1 C O 1 ) ,YG,NQ,h'CL,liCODr? 1 0.31 79 33AT ( 4 1 3 ) 17 (HG .LT. 1 .OR. NG . G T . ( N R D - 2 ) ) G C T O 9 0 0 I ( N C L .GT. 5 ) S O T O 900 - I ( Y Q . L E . 1 .OR. NQ . G T . 1 0 ) NQ = 1 0 L C R 2 A 3 L A B E X S F9.S G33UPS, UP TO 10 CHARACTERS P 3 A D ( L R , l c J C i ) ( ( X N A l I E ( I r J ) , J = 1 , 3 ) , I = l , N G ) 1 3 3 2 ? O R M A " 8 ( 2 . 4 4 , k 2 ) ) DO 5 J = 1 , 3 5 X Y A Y E ( N G + 1,J) = SSUfl(J) C 3Et'LD DATA 3 0 1 3 1 = 1, HG , t a e A c ( r , ~ , ~ o n 3 )X B A R (I), S I G H ( I ) ,W ( I ) 13C 7 FORilAT ( 7 F 1 0 . 0 ) Z % C O D E .F_U. I , 3 Z A D S T A N D A F D D E V I A T I O N = S Q 3 T (LOGVARIANCE) = Si;YA Z : i f O D 2 . H E . 1 , RZAD LOG V A h I h H C E , S I 6 F A * * 2 I3 (HCCDE .'Em) - 1 S I G Y A ( I ) = S Q ! l T ( S I G n A (I)) -I- ? J O N T I Y U E - * - * K I L = SCT, - w E - IF (YCL . G T . - ~ ) I i E A D ( L ; i , l O C 3 ) ( ' I C L S ( I ) , I = l , K C L ) YZLS (r:cL) = 0 . 3 DO 2 0 I = 1 , YG I? (XBAIi (I) 1, E-8) .Li. GO TO 9 1 0 :tYI[J ( I ) = A L C 5 ( X E A 3 (I)) - 0.5 * SISEA ( I ) * S I 3 Y A (I) 21) CI!47I!{U!? C A L L STAT: ( : ( S A : Z , X B A R , X ~ U , S I G ~ A ,W , H;,No-.2 , 3 ) - C I' ( Y C L . G 7 . 1 ) - 1 3 A L L C L A S S (YCLS , Y f i E A Y , P O P , X B A 2 , X H U f S I G H A , U , NG, NCL, 1,XYA?lZ) ;O 70 13C 3 i 3 3 ( 6 ,2 ) 55, NG, NQ, NCL, NCODE , **** ', 13,' E R F O R I!i PhSz.HEETE3S. N; = 1 4 , ' T . T , ? 2 3 ? A - , ' ( 1 H G f ' J O E I , '1 112 = ' , T u f t NCL = ' , I 4 , ' N C C D E = I 1 S" ? 1 U ? . I T ' Z ( 6 , 2 ? 0 1 ) Ja, (XEAB ( I ) ,I=1, NG) 2 1 7 3 3 ! ? A , " ( 1 H P f t **** J O B ',13,' YFI5XTIYE R E A S I-YCCYE. X 9 A F ! ( I ) = I , 1 5 3 1 3 . 6, V f 4 3 X , 5 E 1 3 . 6 ) ) 5 STO? E!i D s ' U J R n r J Y Y E ? T A T S (XNA!¶L,XHEAti,XP!U, S I G ? A , bi, Y ? , H , I ! J D X . I P i i I ' - i T ) C 3 ZIJ3hrlUf I 4 E TO ChLCULATZ DISTRIBUTION S 1 A T I S T I C S AND PRI VT THE;!! -Z K ? I T X 3 3 Y S. F G B I g S C N AUGUST 1976. --!TDX=? ? S i Y CP.LCULATFY Q U A N T I L E S AND HEA3 INCOMES C P C U A N T I L E S IND:.(=2 ALSO C.9iCULIZTE QUANTILES AYD RE;ANS O ? OVEPALL C I S T 3 I - C 3 U T I C ; K , A S YELL AS HP GROUPS. 1 2RIY': TH2 S T A T I S T I C S STORED I N CUHY. P - : Z?3YT=? T N A D D i T I O N , C A L C U L A T E AND P R I N T A F P E Q U E N E Y D I S T E I B U T I Q N " .. FOii 78E OV E E A L L D I S T R I B U T I O N . c ( - ) = NUYBE3 OF QUAHTILZS FOR H RANGES, S O N VALUES OF Q!?EXY -- A P E CALCULATLD. I N DUAX, QUA?M'ILES W I L L B E S T C 3 E D AS S H A Z S S O F TOTAL INCOHE ?ATHER THAN I K C C ~ EL I 3 I T S . P - - "YEAN ZO!JTAINS QU4.UTIL E HEAS I N C O l r E S FOR LAST S R C U ? . - D I ? l 2 N S I O N 7 ( 1 ) , C d E A N ( 3 5 ) , X H A Y P ( 3 5 , 3 ) , XHEAN ( 1 ) , X Y U (1), S I S X A ( I ) , 1 S A V S ( 3 5 ) , i i Y ( 3 5 ) ,i(X ( 5 0 ) , Y l(50) ,Y2 ( 5 0 ) , 2 Y3 (50) , X X 2 ( 1 ) ,'dOI?K1 ( 3 5 ) ,WCRK2 ( 3 5 ) Z3H!!C?/PA;Z/ NPA;E, N L I U E , HDG ( 2 0 ) CO!l,'iO?f / 9 O R K / !iaD,NCD,DUflY ( 3 5 , 2 0 ) 2 2 U T V X L E H C Z ( X X ( I ) , DUflY ( 1 , l ) ) , ( X I ( 1 ) , C U n Y ( 1 , 3 ) ) ,( Y 2 ( 1 ) , D U ' I Y ( 7 ,5) ) , 1 ( Y 3 ( 1 ) ,DU!lY ( 1 , 7 ) ) , (WORK1 ( 1 ) ,DUnY ( 1 , 1 9 ) ) , ( Y O R K Z ( 1 ) ,.D!JrlY(l, L O ) ) ,- L = 1 .Q D I ? E Y 5 I G ! I 0' DUXY b 7 D l Y Z N 3 I O N O f X N A H Z I V A X E = 35 : !IO?YALiZE W E T G H r S 50 T H A T THEY Sun T O 1.0, I? NECESSARY. P - P = l o l C ./?LOAT ( N ) c;u = C.0 9 t ? L ) G 3 T-3 5 0 D O 4 I X = l , N ' 4 S 3 3 Y = su:u + Y (IX) r-' (ABS (SUHY) .LT. l . E - 6 ) GO T O !% D 3 5' I:<=l,Y?' 'r A 5 I = v ( I X ) / SUHd - - * C 4 L C c J T , A 2 Z Q U A N T I L Z S ?OR EACH G E O U P ~ - -J ' j b i = 'I + 1 CAI.', ..- ~ ~F.4SE35) ( ( h , SrC ( 1 0 0 ) xP,NY, ( J J , J J = ~ , N H ) ? l ? r A T ( 1 Y , 5 X , ' AEAh I l l C C U E S OF' Q U A N T I L E S 1 , / / , l X , Q 1 ' > i l A N T I L C S Oi.' ' , F 5 . 2 , ' PEF,CEHT. ' , 2 /, 1X, 'COL I ,I I S Q V E P 4 L L GPO'JP X E A N INCC'(.E?, 3 / / , 2 : ( , 7HCCLUlrH , 7 X f ( 1 1 (15 , 4 X ) ) ) 2 3 : : : (6,3C.1) : 1 ? r ' ? - A ? ( 1 3 , ' z L m 1 ; .V,:;;z = .ILfS1, -7 t ? ( 1 ) ';J T- $.. Y u , 2 4 S ( S ' + l ) = 2.': D l I d K = l , ! J ? 4 ( 1 ) = 4 ( K ? 1) + liil(K) * X ?:FA?;( ) L(I( = K ZIII. 2rJAYY2 (ShVi,N,X?.C:(Y),SIGEA ( K ) , X X X ) 8C4LL ?.EA!JY (SYLA!~,SAV=,J.ZU( 5 1 , 5 I G Y A ( ? ) ,X?EA!i ( K ) ,!i) A I ( 3 3 3 A Y , XtlLJ(S) , S I ; Y A ( K ) , N , K K ) 3'3 3 xK=l,!: 1 ( K ) = .di?..AN (KK) -i:t.-7- * X- 5 2 I E 4 0 Y Q 3 v- 4 u0 N 4 O X U 4 0 m U .= II; a:= , m - Z 4 C I H W N3 3 r.u 4 H 13 3 z 2 4 ffi w H I1 I1 v) W H 3 --u C m + 3 w z cr a Q H C O ZI: W D V ) K 5s a 4 Irru q D o a a 0 rn 5 4 w -c + Z \ z H n Z 0 · 4 4 E *- W 3 H A + , w a c r m 3 w x N w . a ~n3 -- N r ~ n=lo z u ti z 2 H w crc H a \ z --= a u 3 z z H-- z .x 8 --- I] U oHOLC3-4 Urn Q n 003 I X u W I C 0 W * C . -- 3 x n o - c w H * 0 Z V 0 + K 9 b W 3 =, -.- 4 U W = + . p . b. . + N O & b P - ; * x t n c- I1 ' 0 -x! e z . 3 ~4 Y H M 143 ~ X F ( * 0 D .V Q % 3 - X % .1 x D \ u - H o I-I - w ~ t m w u 0 - 4 o w o a a w * m H X = a + m z m r 7 U c.3 0 WI: 0 ru 4 0 W Z-Q4 13- 0 - WE-( 4 3 \ 4 -- T. W ,It 11 "r. z o4c4t 0 - - x 4 \ 1 l Z r * A Y + + o m m e = w 3 7, -c- -3 K cl- 0 D, m r 7 \ m c Z I1 - U M H 0 Z + h V H W ' 3 + l U =5 + N N 2. r U + n - X · 0 7 . X N 3 H C . r 3 H 0 Z \ d + m b ! Z C L HhE-1 r *- i N P1 CCO o n e . . b Z 3 r : V ) 3 r : v ) - - W w7. O r C r - H 4I: + + HO ~ E 4 \ Z O O ~ l C O P - ] H H m X X + 7 - Z . c - r r = z x 1=x - - D4 1 1 3 1 1 b - i 0 I I W 7 . 7 . Z i P'ddUVO * I 1 3 * Z Z H H W C Y O + E - ( ' 3 3 Z H 0 C 0 1 1 0 I I W X 11% \I o --- o k 4 w - 1 0 1 9 0 rdp! . L O O H W O ~ - - w P W O ~ W M I- ~4 1-1 I, 1-4 II 11 b %: LJ l..i7.?r,zX l ' d r . ~ H D ~ r P 4 C c z 1 3 0 . 1 4 - L:z 3 v ) Z F I I m I I II II r7 II N V1 I I O I I C , w F , m o Z F-4 E 1 E R; 11 11 0 I1 11 7. H O U 0 I1 11 11-a; H 3 4 Vr3 3 4 0 4 w r r a- 4 d-t.c* 4 4 C 3 O I l It P z 11 e 3 5 x ki 11 H h 3 K P I 1 4 0 m - X N R X M W C r/) r: I: 7: ,A I ! c J r ' : E C ~ 1 w 2 . U XS2 I:n' Xu-' w L 3 E r ~ F * C 3 0 1 r ; . trl** 3ltk'i!3 X 3 ~ 3 ? 3 2 kc 3 0 3 0 3 3 4 = 3 3 Z L " ~X ~ . P ~ @ E J D L H ? ~ ~n 8 n , 0 r ~ r ~ , ~ ~ 3 3 w O D7. = r~ ~ z ~ x @ ~ r c ~ ~ tqa~qaa o ~ u a a at ~ ~ ~ ~ ~ a z v , t ~ a ~ ~ ~ ~ w z e ~X ~w , w X w~ U I wX U~ ~ ~K u ~ w 3 cl 4 ~ 9 0 ~ In v, I: O O d d 7 . a O 0 G 0 3 C , x - N U C J Y z a Q P 10 a v o ~1 LJ r ) r j t.! ' 1 ' 1 [ I u :I L Jt' S A T 1 0 = 12O.*SI;XA3/(SIGHA2*SU!!W) I 7 ( S I 5 ! I A 2 .IT. d . 0 ) GO TO 25 SI;YAZ = SQ3T ( S T 7 3 A 2 ) -- ?ZT!J3N SIIT?,Y LNO?.'I1 [ X J 0 2 . S I G Y A 2 , X , C ! U , S I ; H A , U 8 N P , R A T I @ ) " ?ECGIA!! ' 0 EETIYAT': P A R A ! ? E T E 2 S Or' A LOGYC3,LIXL D I S T , XFrJ A H D SIrtfi'i " 3 Y YZTHOD OF C U A H T I L E S . SEE, A I T C H I S O N A N D BRCY 3 , F A G E S 46-UZ t T d O 3ETS O? TWO Q U A I I T I L Z S A R E NESDED. FOR XHU, Q U A N T I L E S CS f T H E 3 V ? 2 A L L C I S T . A R E C A L C U L A T E D AT P = . 2 7 AfiD .73. PC5 S I G R A , C - TYZY A 2 2 P=.93 AND .07. b C A L L QU AN T ( x , 1 , X ~ U , S I G ~ . A , U , NF, .73) X l = .u ( 1 ) CALI. CUXNT (X, 1 , X ! l U , S I G P l A , J , tip, . 2 7 ) x z = :1[ ( 1 ) -- Y Y U 2 = O.S* (ALO; (X2) +ALO; ( X I ) ) C A L L NORINV (. 9 3,ETA,IEIi) I? (IFF .2Q. 1 ) S O TO 2 5 X 7 A = 2.9 ^ ZTA :ALL QUAN'I (X, 1 , X 5 U 8 S I G E A 8 W 8 NP8. 0 7 ) X I = X . ( l ) C A L L QUAN"X, 1 , X Y U , S ? G E A , W,h'F,. 93) x2 = X ( 1 ) S l ' , n A Z = (ALOG ( X 2 ) - &LOG ( X I ) ) / E T A E T U B Y 2 5 U P I T 2 (6,lCOO) l L L 3 C O R t l A T ( 1 H , '***r'AILURE T O F I N D E T A I N L H O P E * * + * ' ) X Y U 2 = 0.0 S I G Y A 2 = 0.0 ?.ETUi?Y END 3 r J B F . O U T I N E H h T O U T ( 2 , S N A L Z , NliObi, NCCL,K?CW, K C O L , K S , K K , L S ) DI!lZHSIJN Z(KROd,KCOL),SWAHE(K5,3) - CC)HlON/PAi;E/ I I P A G F , k ~ ~ I N E , H D G( 2 9 ) b t = S T Y G L E P R Z C I S I 3 N H A ' I F I X ' I C 97 P F I Y T E C C 3 5 N A F Z ( 1 , J ) =f!ATRIX O F BOW NAMES, I FOR BOW, J = 1 , 3 PCK 3 I 4 F D S Z O t A 1 2 C H A P A C T E F S T R I N G c V ~ C W , N C C L= N O oz aous A N D C O L S 70 B E P R I N T E D : K30d,KCOS = D I t l E N S I O N S O ? Z I N H A I N ?EO;SAH L KS = f I H E I ! S ? C N (31 SNAKE ?h' ? l A I N P3OGQF.Y C i ( X = YO (3' D I G I T S TO R I G H T OF D E C I Y A L D C l N T C ,-. LS = OPTICN FOR S K i P P I N G L I K E A N D F F T N T I H G C O L SUYS - - . I? L S . ; 2 . 1 , (HROWt-1) TK ROW I S P!?INTED A F T 5 3 SSI-7PZW-; .+ LI!4Z. Z h ' ? C C i = GO. OF C O L U V S A C R O S S P R I N T E D P A G E . SET T O 13 C 3 i l BA?:Ff - " U T P U T . S E T TO 5 P S E ? T S R E I S A L O U T P I I T . H ? C O L = 1 0 KP = K K + I - I 3 ( K ? .GT. t ) K:^=-) 5 = 1 = NPCOL W ' L :.I (nl S T . :ice,) r,n = NCGL L S X A T = 1 S E N D = K3OW L S Y I I = L S 38. ; CCL. YCS. ACFOSS PAGE Y?ITE(lW81C11) (I,I=?l,MH) 13 11 ?3B'!XT (1 H ,1X, 'ZOLU!l,Y ',7X, 10 (15,5 2 ) ) iiSITE(L J8f C12) 1012 ?Q9"lAT (19 ,lROU ' ) N I T Y E = !iLJ!IS + 2 '3 D 3 30 I = ISTART, SEND N L I Y E = N i I N Z + 1 G3 TO (10,11,12,13,14,1 5,16), KP 10 ii317E (LV81030)I, (S!'iABE(I,J) , J = 1 , 3 ) , ( Z ( I , J ) ,J=n,Pn) " 1309 ?O?!?AT(lH ,12,1X82h4.A2,10 (P1O.O)) GO 30 11 i i ? I T Z (iii,1091) I, (SNAllZ (J.,J) ,J=1,3) , ( 2 (1,J) ,J=tl,r!r!) 13C1 7333AT ( l H ,12, AX8 2Xrl,A2,10 ( E l O , 1) ) G3 TO 39 i2 W3ITZ(LW,1002) I, (SSARE(1,J) , J = 1 , 3 ) , (2 (1,J) , J : d,!!?!) 10Q2 ?CRYAT (1H ,I,?, 1Si, 2 A U 8 A 2 , 10 (P10.2) ) GO TO 30 13 ;13172(La, 1093)I, (SliAnE(1,J) ,J=1,3), (2 (1,J) #J=!!#HH)I 1323 POFYAT(1H ,12,1X8284,A2,10 (P10.3)) G9 TC) 30 14 U 3 I T E (LW,1004) I, (SSAEE ( 1 , J ) ,J=1,3) # (2 (1,J),J=H,d!?) 1504 ?O3YbT (1H ,12,1X82A~,A2,lO(ElG.4)) SO TO 30 1 5 U R I T E ( L % , 1005) I, (SSAXE ( 1 , J ) , J = 1 , 3 ) ,(Z(I,J),J=kl,?l!!) 1035 ?DP!IAY(lF! ,I2, 1X. 2BU, A2,10 (P10.5) ) GO TO 30 16 WsITZ(LW, 1OO6)I, (SBAH'E(I,J) .3=1.3!, (2 (I,J) , J = E , Y Y ) 1096 P C ) ! i ~ A T ( l I I ,12,1X.2b4,82,10 (E10.4) j 30 C13NTINUE II.(T,SKIP.tE.O) 1;D TO 35 u? I r z (tu, 2 ~ 0 0 ) 2303 ?OBYAT(lH ) NLINZ = HLIYE + 1 LSKI? = 0 I LSTAET = NROW +1 L Z S D = LSTART I I S Q TO 8 \ CCf Dr) Y E H A V E 3OaE THXH HPCCL COLUnNS T C FF.IYY? I 35 I? (fly .GE. HCOL) G O T 0 7 5 CCC W I L L T H E Y PIT O H SA3E OUTPUT PAGE? i N U C i I S = !ILIYE + HA3D + HROW a ' CALL PAGE3 ( N U H L I N ) VRIPE(LF,2001) 23111 F O S Y A I (1 HC!) - Y L I ! i Z = NLINE - + 2 - *& 7 3 ! l = 5 3 + 7 'I L fly ?!I+ NPCOL - -- - i;r3 'IC 5 7 5 B E T U F N E a E N D I S 9 3 3 C U T I N Z n t A N ~ ( X , C I f C 2 , X n U , S I G 3 A , : . ( \ 1 E A N f P 3 C B ) t SUZ?.OU'!'INE Tfl C A L C U L A T E EEAK I I I C O U E C P P E C P L E B E T W E E N Q O A S T I S E S C Q1 A H D y2 703 A L C G H O E E B L DISIRIBUTION. I (92 .GT. 1 .2-8 .h N D . 42 .LE. Q 1 ) GC TO 900 I? (ASS ( X Y E A H ) .LE' 1 .E-8) X R L A N = i Y ? ! X r U + C ! . 5 * C I G E A * S i G n : , ) X I 3 2 = XY!! + S I G A A * SIGHA X I = 3 . c X 2 = 9 . 0 1 ( Q l .ST. 1.E-P) X I = (ALGG(Q1) - X F U ) / SI;flA -T - T (02 .GT. 1.2-9) X 2 = (ALOG(Q2) X Y U ) / SIGflA F1 = C . C 72 = 1 . Q I ( p i .<'I.1.2-9) C A L L soaaar. ( 7 1 , X I , I E a ) I?Q2 .GT. ( 1.2-9) CALL KCRHAL (P2,X2,IER) P3C9 = F 2 - F1 X I = 1.0 - :<2 = r1.9 1 . 2 - 3 ) - . X1 = (ALOG(Q1) / SIGP!A 7,: (21 G?. X F U 2 ) I F ( 2 2 G 7 . 1. E- 8) X2 = (ALOG(Q2) - XYU2) / SIG!¶A 71 = 0 . 0 F2 = 1 . 3 13 1 .*GT'. 1.2-3) CALL NOSXAL ( F l 8 X l r I E i ! ) T ? (C2 .GP. 1 .E- 8) CALL NOBHAL (P2,X2,IER) 2 5 0 3 2 = 7 2 - r'l X = 3 . 0 I? (XSS(P3OB) .GT. 1 .E-8) X = Y.3EAN 4 P F C B 2 / PROB ?.ZTrJ.?Y ? c 9 d3TTE(6,1gC@) Q1.42 13C'C ?02.Y.AT(1B08'*xm* ERROR IY EEANC. C;1 = ' r E l 3 . 5 , ' 4 2 - = ', 1 5 1 3 . 6 , l ****I ) 3ITU2 !4 2 4 D S'J93OLITINE HEAHY (X,Q,XRU,SIG?lA ,Y.!!EAN, H) -- 31 !!2!4SiCN X (N) ,Q ( Y ),P(20) 3 SUSROUTIKE TO CALCIJLA'TL' JEAN INCCHES C? C;UANTILES CF i.l)rj?iO?%L DIST. G L V E Y I N C C C I F (Y .GT. 20) GO TO 910 SUY.< = C.0 D l 1 0 1 = 1 , N '22 = Q (1) I? ($2 .LE. y l . A N D . (22 .ST. 1 .>8) GC T O 9C0 CALL Y 3 A Y Q (X (I),Q 1,Q2,X lrU,SIGHA,X!lEAN, F (I)) 1 = (12 SUE? = SURP + P ( 1 ) 10 SOY.< = svnx + x (I)* P ( I ) I 7 (AES(SU3P-1 . 3 ) .LT. 0.00' . A N D . AB':(SIlYX-X.?F.ANjl .LT. .OC l1X?IZAY) . 1 5 Z T U F . N L 73iTE(6,27OG) SUnP, c u n x , XnEA3 205G 79B!lAT(1H0,'*-^ 1.V B E A N Y , SUYP = t , E 1 3 . 0 , 1 SIJ.TX = ' , 3 1 3 . 5 , 1 ' X f l i A N = ' , E 1 3 . 6 ) P S T U R Y 0 'd?TTE(6,1300) ( Q ( K ) , K = I , t i ) IUCC ? O Q ! l A ? ( l H C , t x * ~ *EEKOR IN H E A N Y . C(I) = ; , ( 5 E 1 3 . 6 ) ) P.EIIU3Y 9 1 0 ;IYITE(Fj,lCCl) N .E 1 O r j 1 ?O!?!l.JIT ( 1 E @ ,I+**' Z R R O R IN R t A : i Y , N = ' ,151 9 Z T t J 9 N 3 Y C S U B F V U T I N P Y E A S Y 2 (X8Q1,C2,Xflil,SI;XP.,3 ,?iF,XX,??) i.lIlS!iETCN X R U ( S ? ) , S I G f i A (SF) ,Y ( S T ) , X X ( S ? ) , P R ( N ? ) f- - S ~ J 3 B 3 i J ~ Y TO E CALCJLATE XEXSS CF QUASTILES gr ZYE3AL:. CIq?912'JTI2? 121 A Y D c2 AFIE Ti10 tQUnI;TILES. QUASTILE ISIFAN OT DIST 3El-iiZZ:i T H 3 Y T d O S U 4 Y T I L E S I3 C h L f U L A T L P B Y SL!?YI?!G E E A K S O F IKUIVIDUAL D I S f S I - 4 0. T 30TI3NS 3 X Z E E N " 2 SAPE TWO IHCCCES. T ? C I = O . C , F A K G E I S P R O 7 .*,INli3 ,- IS?IV::Y. 17 QL=lj.3, Y A N G Z IS 70 PLUS IKTINFY, P - f-. I (c? .CT. 1. 5 - 9 . A N D . Q2 .,LT. QA) GO TO 9CO s:sz = c . C DO 1 1 1 = 1, .V=" X Y 3 4 r : 0.3 CALI. YEA33 (XX (I),Q1 , Q Z , X E U ( I ) , SIGXA (I),Xl!EAH,PR ( I ) ) 1 3 S T ? = Z!j!l + W(I) * PR(I) X = 3 . g I' [ZU?? .LT. 1 ) RETUaH 30 ? 3 I = 1, N ? 2 3 X = V + W (I) *23 (I) * X X ( I ) / SU.1 72 7rJ ?!i 9 c J % ? T T E ( b , 120C) 91,Q2 1 70RY.17(1HC),g**** 2 3 R C R 1 6 P.EANY2, G 1 = t , E 1 3 . 6 , t 42 = ' , E 1 3 . 6 ) S S ? 3 F X EY 3 -- S r J 3 3 C U ' T I 6E N O Z n A L (?Y, X, I E R ) T SUa30UTIYE T O CALCULATE KCRHAL I S T E G P A L F F C H Y I N U S I N ? I N I T Y 70 I AbC ?Z?U£iY TBZ VALUE IF FY -1 ENT3Y !lrJR1!lT4 TAKE3 ?Y A H C RETURNS X --. 7 7 3 = 1 I? IS AS T!iZ-?E EFRCF. P - - - U S Z I T ? - f l C U S E L I B Q A R Y ROIJTINXS F09 T ? i E S X A N D 4 8 D 7 , -3: 3qUTTNE C A N '7 -- NC?.'?AL 4 Y D INIIZ;tS': K O 3 L A L I N T E G F A L S . THEY AEE -. 2='2 A N 3 H L Y A I S FCF I E U 3 6 0 3 1 i Q 5 Y .4ND TINOi?Y F39 U N I Y A C 1 1 0 8 P - - P I?? = () r r ( S T . 1 . 0 53 TO 100 I' ( K .IT. - 10.3) G C T C 110 c PY = ? ~ n ~ r . (x) ,- - F Y = 3. 5 * ZS?L (-SQRT(C.5) * X ) C A L I r c ~ (1,FYI ~ i -.s-7 L . ua:i 13fl - Y = 1.0 E;377?X 110 ' Y = ? . O . PTTTLIRY f ?NT?Y SCFIYV (PY ,K,IEF) 3 = -- T: ( 5 Y .ST. 1.i) .3R, P Y .LT. 6.0) GO TC 9CO x = ~ ~ ! r c $(7~,33:10) r ,- \-'.ALL Y D ~ I (?Y,:<,I E R ) S !lF-?YEi:l 3 0 5 d ? T T E ( 6 , 1 7 C 3 ) FY, X 1r)r)rJ 232?r(?(7H0,1*mt*EFRCR IX N C R I N V F Y = 1,F12.6,1 X = ' , f 1 2 . 6 , 1 1 ***I1 ;?R = 1 :! = (3.0 3 C ' I U F Y EN 3 -- S:JE3?CrJTI!l?S O Y 1 (X,F) ?U:iCT:CV IIC C A L C U L A T E S T A N D A F D N O R X A L I N ? E G ? A L F F C ? I V P I Y T T ' i TO X C - :IV;lS 41. . . . = I . U ? l j T V;tL[JE r ? = VILJS Cr' T:I?ES9AL - ~ f r ' ~ : ? "1 s ? . 3 - 7 9 = > F 3 3 k E I L I T Y C Z N S 'L" A Y AT X ;A;\" -4 l,AZ,A3,A.(,AS,A5, A7 / 0. 2 2 1 6 4 l C , 2.31 9391 5,-9.35.3563:, 1 1 .-3147a, -1 . b 2 1 2 5 b , 1 . 3 3 ~ 2 7 4 , c . . x 1 e s l r ; 3 / - 4:t = a 4 s ( v ) . -- 1.2 / ( 1 . ~+ 3 1 * AX) 3 = A7 * E:!P(-X '.Y/ 2 . C ) = I.?-I?.?(( ( ( A C * T + A 5 ) * T + A Q ) * T + A 3 ) * ? + P 2 ) ,S -. ( X ) 5 ,'c , 1 9 5 2 = 1 . 7 - P 1 9 ?.:f-Jfi!? - 2 !ID SrJ8?2'J7T?E N O S E 2 ( X , P , I E F ) Z S G 3 3 7 L T T : J E Trl CXLZLJLATE I N I E i ? S E N G R E A L I 6 T E G 3 A L Z i? = VP.LrJZ C ? I!K'2G??L .LL. P .I,?, 1 - % = C U i ? U ? V A L U Z 6" X 5 = ??PC2 CC!iDITICN = C I F NO E F P C 9 . -.,. = 1 I ? - Z ? ? C 3 - r . 4 ~ .Z X ~ O FI S . C ~ 3 4 5 3 3 = F 3 C R A 3 I I I T Y D?YSIIY AT X 3A7A 3 1 , 9 2 , % , 5 4 , 5 5 , E 6 , 9 7 /2.515517,'J.6G2853,!?.i!10228r1.4327e~, 1 2 . 17326Q,3.i,3133Q,C. 3CF?4;3 / '?E = C Ir. = 1.CE73 3 = x Zr" ( ) 1 1 , 1 4 , 1 2 11 I?? = 1 S(: T'3 5 c 12 r 7 - (9 l.C) 1 7 , 1 5 , 1 1 1 4 X = - 7 .?E-70 !5 D = '2.c GO T C 50 1 7 D = P T? ( C - C.5) 1 9 , 1 9 , 1 8 12 D = 1 . 3 - I ! 1 3 m i - = A L n ; ( l . 3 / (U = 3)) rn - -.- SZRT (T2) = T- (El+rj2*-:+B3*i2 ) / ( l.O+E4*T+Dy*TZ+CE*':*T2) I?(> - 3 . 5 ) LC,Z'),21 23 - x 'a: = . L I 2 1 D = 37 SY? ( - X * : ! / ' L . O ) 5.3 !?Z7'J3!4 z y n S'JSfOil'IIX-? ?A;E3 -. (?I) . C3Y!!O'J/PAGZ/ !lP;\G3, 6LI!1E, HI:G ( 2 C ) **4; T 7 ( 1 .L?. 55) JEYUFK .. 4- ;i?IX(i6,1!?CC) ( d D G ( J ) , J = l , Z C ) , S P A G I 103C 7 0 ? ? ~ ~ ( 1 ~ 1 , 52 J: A,Q , 5 i , ' PAGE i q ,1 3 ) il ~ ? I T E ( 1CC1) ~ , ir?nl 71?'?A: (1!i ) ' i : T U E = 2 ':P 9,;z - = KPAG': t 1 7. .l r- .-.J 5 '1 Z'i F ;73?3UTIYZ QL'k!;: (:i,!i,X.',U ,SiG?r.A,ri,! I = , F E C E ) D: u ? s . < T r s Y (:i) , . i u ~ ~ (,s5r 1) s (::F)~ , x ( Y F ) ~ P"C';?A' "> F ' T ~ T ~ : , ' ; ~5- 1 ;l]A!i'-ILzL f'ITNzNC; 3 ? , \ v G E S 4 2. c C O Y X I Y X Y G I/!: C? ? H E FREQUENCY. T H I S 1 5 CCbE ? O R ? H E C V S R A L L Z D : 3 ? 3 I S U T I C P CALCULATkD 9Y CUflbE. 7 0 3 Z\S!i CUP.Y'IILE, GUZSS A J LBLTIAL V A L U E E Y TAKISG T H E C G3CY3'1317 YEAN 02 THP SAHE CUANTILE ?Oil ALL 3 E G a O U B S . C USE YEaT32: I ? E ? B T I O N S KITH !iUnEitICAL ISTIEATE: CE THE L E F T V A T I Y E C: l r X : ( ? 3 Y = 2 5 -" .LS" c'.0001 t::' = 8-1 ? ( 1 ) sb'-1 P = 9.3 DO 203 K = l , Y N P = P + l.O/PLOXT(Y) I? ( 3 1) P=PRCB C 7hXE I Y f T I A L G U E S S CALL CiJED? (P,XX,XEU, SIGHA, W,NF,O) : U ! ! Y ( I , J ) = D U 3 Y ( I , d ) * L ( I ) 245: ACDE3 (CUEY ,v?,?:,SFD, NCD) DO 23 T= 1,SP 3 7 23 ~ = 1 , ! : 20 3 U 7 Y (I,J) = 100. *DCRY (I, J)/DUYY (NF+1 , J ) P - ? U l J U A Y T T L E S I Y K P + 1 ETJ'rl O F D U l Y Y C I J Y i T = 1 . 0 I I D3 2 5 J % ~ , Y 2 5 D [ l Y Y ( N ? + l , J ) = UYT: * X ( J ) Jfl?lY ( ! I S + 1 8 N ) = 3.0 3E;T'JRY . -- 223 G??TE(O., lr!O?) Xi, JJ '2 1 3 0 0 P.3P.iAT ( 1 9 , ' * * * 2 ? ? O i ) I h QUANT3. G ~ C U Ft 8 1 2 , ' - - CUAN'XIL? ', T2, 1 I " S + ' 1 * E .?E'?U?Y * I E'i D I J J I $UASTu(XNA?E, X Y Z b Y , X I l U , Z I G Y A , V,V?,i!4F,.?E) DT7FYSTOH Y . N A i l E ( I S A P E 8 3 ) , X H E A S (1) , Y t U ( 1 ) ,SiG!k ( 1 ) ,ii (1) , < ( I ) , 1 1 3 3 K 1 ( 3 5 ) ,73RKL (35) C3:!.Y,CY/PAG E / Y P X ; E , ? i L I H E , H E G ( 2 0 ) C3VYGV /%OF';/ N a C . SCC,t;L'ZY ( 2 5 , 2C) - E ; ) ~ I Y . ~ L E Y C E ( Y J (~ iY, i ~ r ) ,~ O F K (I I ) ) , ( L U . ' ; Y ( 1 , 2 c ) , u n 1 7 4 2 ( 1 ) ) L 13 S ' J S 3 ~ ' J T I ' ~ r "TO CXLZJLATE ASC P313'; DIST?IFl!TI!IY S T A T I S T I E FC? 7 T 3 F 5 ? E ? C E J V . : i D r3? 1 ?EFCENT G? DISTEi31JTICb C rJ:IIT = 1.C 4 4 . (32 = 9.0 DD 1 0 0 T J = l , 2 I7 (IJ.EQ.1) P=. 95 I F ( I J . E Q . 2 ) P=.99 P? = 1.0 - P P ? E = PP*100. D9 1 0 I = l , Y F I1 = I e .' CALL QUANT2 (Q,1 ,XHU (I),SIGRA (I), P ) Q l = Q ( 1 ) I? (Ql .LT. 1.E- 6) GO TO 900 C 4 L L .'!ZAHQ (YX,Q1 ,Q2,XFU (I),SIGflA ( I ),X!!EAH ( I ) ,F3) I (XSS(FE: - P3) .GT. C1.005) ' R I T E ( 6 , l C l O ) I , P , P 3 , P P 1 9 1 3 F3511AT(1Hfl','*** I!: QUAlI'l4, I = ',T4,' P = ' , E 1 3 . 6 , ' 2 3 = ', 1 1 3 . 5 , PP = r , E 1 3 . 6 ) IP ( A a S ( ? ? - P 3 ) .GT. 0.005 ) H L I Y E = NIIKE + 2 D U A Y ( 1 , I ) = X X g U N I T 1 0 DUYY (I,2) = 1 0 0 . *XX*?P/XHEAN ( I ) P - CALL QUA HT ( 9 , 1,X XU, SIGHA, Y, HI', P) Q1 = C (1 CALL P!EAYY2 (:<:3,Q1 ,Q2,XHU,SIGHA,U,NF,HCEK1,YORK2) D U Y Y ( 4 E + 1 , 2 ) = IOO.*XX*PP/Xf!lEAN ( N f t . 1 ) D U 3 Y (4?+ 1 , 1 ) = U Y I ' ? * X X srjq = 0.C DO 2 0 I = l , S P x i = ( A L C G ( ~ ( 1 ) ) - x n u ( r ) ) / SIG~A (I) CALL SOEAAL (XX1 , X 1 , IEF.) D J Y Y ( I , 3 ) = l o o . * (1.0-XX1) DlJ !lY ( I ,4) = DU3Y(I,3) *k'(I) 2 9 SUI = s u n + Dunr c1,4) DO 25 I = l , S ? 2 s D U . ' I Y ( I , ~= 1 o o . * o u n r ( 1 , l r ) / s u n C DUXY ( Y f ; + 1 , 3 ) = i'PP D U ! l Y ( Y ? t l , 4 ) = 1 0 0 . YYfLIN = NLISE + 8 + HP I F ( I J .EQ. 1 ) NUYLIN = 1 0 C C A L L P AGE R ( Y u n L I N ) a I = (YLINE . L Z . 2 ) GCI rn 50 WS I T E ( 6 , l O C 1 ) 1 0 0 1 P3RYAT (1H ) - N L I Y E = HLi!IE + 1 '9 L 50 W EI?: ( 6 , 1 1 0 2 ) PPP, Q1 1 0 0 2 P Q R Z A T ( I H , S X , ~ ~ A N . A L ~ S IOSF TOT ' , ~ 5 . 2 , 1 P E R C E N T C F I:Ncgnz c, 1 ' D I S T S I B U T I C H ' ,//# 1 1 , 'QrJANTILi: P O E O V F 9 A L L CI.5T3JEU"i'OY I S*, 2 P12.4 ) . * N t I S E = NLINE + 3 r l (TJ .EQ. 21 G O T O 55 M3 ITE( 6 , 1 0 0 3 ) P P P , P P P , P F E , P F P 1 0 0 3 P3RYX"lH , 'COL 1 IS H E A N I l C O l F S O w TOP I , 1 2 ? E S C = H T 3 P EACH G ? C U ? ' , / , l X , 2 ' C O i 2 I S S B X 3 2 S C F TOF ' , F 4 . 2 , ' P E R C E Y T I N GROUP I H C C 3 5 ' , 3 /, 1X, 'CCL 3 1 5 ?ERCENT OF SKOUP ?C?ULATICY I h T C F ' , F 4 . 2 , 4 ' P E a t E N T OF OVERALL IXCCHE DISTRIEO'IICN',/, lX, '5 'COL U I S PZRCZHT COHPOSITION OF TO? ' ,P4. 2 , ' r'E3CE57' CP ', 5 ' OVEBALL DIST?.IBIITICHf ) N L I Y Z = Y L I Y f , + 4 5 5 .U?-IY( 6 , 1001 ) S L T U E = !I:ISE t 1 -- C A L L YATZJT (DU 3Y ,XYA!!E,H?, 4,N3D,YCD, IYA!lZ, 2 , 1 ) 1 0 0 COYTTNrlS 3:7uI?!4 3 C O U---, ~ E ( 5 , 7 ? C 4 ) 2 Q 1 1 C 3 4 ? 3 " 1 1 A T ( l ! i ? , ' * * = 2 3 f i O E 1 N QUALJT4. C 1 = I , E 1 3 . 6 ) N L T S E = Y L I Y E t 2 3?TLIS.V Z S 9 SU33OUTIN': ?53T (LENGIH,NiII:Tli, X,N?TS,NY,Y1 ,T2,.Y3,Y4,K'c'Y, NO?FN?, 1 X r 4 K , X 3 I N , Y Y A X , Y H i ! l ) f 3 ? 1 1 C H /FAG?/ YP.\?E, SLiNE, P D G ( 2 O ) - Z S C B 3 r ) U T I N E ?LOT S C A L E S ANC DFAYS P R I S I E F FLOTS, A YAXIHCJfl 2 PAGE GRAPE. ---- i r 3 I T T 2 N S?Sf!JG YE37 1 3 7 5 BY A L I C C ANNE N A V I N AND SHERCA!I R O B I N S C U , F6IYC'rTON .- U N I V E E S I T Y . R t ' d I S E D S U t f F E " n 1 5 7 6 TO I N C L U C E SUB. P A G E 9 Y I - 3 - ? 9 D T I N L F 4 N K S 4ND S O F ' I S U F TO 4 VEC'IOSS, T H E LIEPEYDEX 7 P F I A E L E E . A S E T Z Y S T22Y TO P -- - .4 2 L I Y E Y S I O N A L A F R A Y , S A V I N G O F I G I Y A I . S U B S C S I ? T S . I'ITZGE? fLX?ii( 3 -- YLABEL C I Y Z N S I 3 N 931 2 1 , I F LESGTH FAX. G Z Z A T E S THAN 1 C 1 B E TC I N C S E I DIY!!NSIC!i X ( 1 ) ,Y1 ( 1 ) , Y 2 ( 1 ) , Y 3 ( 1 ) , Y U ( l ) , DT YESSIC'N X (N2I:S) , Y 1 ( ? i ? I S ) , Y 2 ( N P T S ) 8 Y3 ( N P T S ) , Y U ( E P T S ) , 1 LOT ( 4 ) , U ~ A F . K ( 4 ), L C O L A ( 3 ) ,LEOHA ( 2 ) 8 2 y U . 4 7 C ! l ( 1 1 ) , Y L A B Z I , ( 2 1 ) , L I N E ( 1 C 1 ) ,JL ( l C 1 ) , X L A E E L ( 1 1 ) C 3Z7:1?'1 SAVINGS CAN 9E 5CHIEVEC B Y 2 A C S I ) i G 'IHS FCLLCUING A R R A Y 5 AS .43';[l!lEYTS A N 3 G I V I SG ?HEF! V A F I 4 E L E C I 3 E Y S I O Y S . I- - C T? Y A X . Y??S C 3 A N ;ED 7 0 ;C),EA?ER TEAY 1 0 9 , STJ3FCOTTbE I I A N K A I ;-'.AS Y i O D T E S Y S I C N S TO CZANGE--1EK ( 1 @ C ) , I ? Y ( 1 G C ) ----2 / 1 9 / 7 5 LSiYlENSTON CUYY ( 1 3 0 ) , E A 6 K Y (4,100) , I P T Y ( Q , l o O ) , I ? T (100) ZCC U Y I V h C NEEES UPPSR C A S E I I N L I F U PC PA!?. CCC D A T A NF.ARK/'*', ', I t ' 2 ' , ' G ' / , B L A N K / ' I / * 1 YWATCH/' 1 8 1 2 ' , ' 3 1 , ' Q f , ' ; I 8 ' 6 1 8 ' 7 1 0 ' ? 1 ,'9' , l @ l / , - 2 L C Q L A / I - - - - ---- , ' I v I - + ' / , L R C Y X / ' + ' , ' 1 1 / C ?OPL"RAN U N T T L L I Y i ; PRIYTEB LY = 6 C Y U S T T Z 1 NU*.eEii P O 2 P O U S COYN, Y L A B E I S Y ? = 5 141. 533s 2EF 2A;E C = 5 1 I !I,?? c LIYL'!' F C F T I C N O T A T I C H L h E P Z F O ? ? T F S K C E E T H A N 3, F E I N S E ? T 0 Y I Y E = q 1* f Y r J L 1 I F L 2 ?O? C C L U A Y S ACECSS, X L A E E L S NT E!: = 1 0 7 A A . L E Y G T Y 0 1 Fi9WS I S 1 0 1 , A 2 P A C T GFPPIi, 2 / 1 C / 7 5 3XXLE:I = 1 0 1 - I T (LZNGTrl . L E . 1 ) G C 7C 1 9 4 B C A 5 . 4 YTdTT)TH OF C d L S . ALSC IS 1 0 1 , TC ? I f 1132 FEIATEE,; S ? A C E S . ??.:(;iID = 1 0 1 I? (Y'dTDTF! . L Z . 1 ) GO T C 1 C 9 . .LE. T 3 (!4Y 5 0 3 . Y .CT. 4 ) G C T C 1 q 9 1 7 ( 3 3 T S O ) G O 10 1 7 9 T F ( . L E . 3 .OF. K E Y .ST. 4 ) GO TC 1 3 9 C -- -c- - T? ALL Ct', F R C C S E D S I T E F L C ? z3!1: 1'11J z ?SU:;D T!!F iiIrJ'I3 'J? TC A uIIL,TI FLL OF 1 3 CGL:l'!lj + 1 ;'C? X L P B E L (KW) . f C C K 3 Y = 3 K A Y Loti37 ?!-I'cSE 'IALLES 46. a V d T 3 l H = YISO (N'dIDTH,flAXYID) - ':YII) = (YWICTY - 1 ) / H'XEY I? (7gD ( ( Y d I D i H - I ) , S T Z N ) .HE. 0) YUIC = Y?IC + 1 ?iXICTY = SWI3 * STES + 1 N? = Y?ID + 1 3 C U Y C T Y = LENS7:I rJ? TO 21 AUL'II?LC OF 5 ECWS, ELUS 1 FCF 90T'TO.Y L I Y E i17H ZCC KEY = 3 2AY L?'.'EP TRISE VALUES L???;?:! = llT?13(L2Y GTH,AAXSEN) I 2 N = (LSYGTY - 1 ) / NZ - I? (!Il;iI(LZY.5TH - 1,Nf;) .YE. 0) LEN = Z E N + 1 LZYZTH = ( L " r * 92) + 1 '3 Y I L L O S Z F g S YXKIS LABELS, 1.E. 2ACH + L?YE. '11 = L F!i + '1 3 2AYY Y'S HIGH TO LCW 30 1 7 J = I , N Y 313 15 I = 1 , N P r S SEI TC ( 1 1 , 12, 1 3 , 14), J 1 1 3 f l Y Y (I) = L 1 (I) G'3 7 C 15 1 2 f ) r l ? l(~T ) = ~ 2 (I ) "I:!I15 1 3 D U ? Y( I ) = Y 3 ( I ) GCI TO 1 5 1 4 DrJ!!Y ( I ) = Y U ( I ) 1 5 C'JNTINIJE C T? ( ' I . 9) GC !iC 10 i i ? I T E ( L Y , 3 ) 3 203Y.1\7(1H@,' J ',1X,' 1 ' . l X , ' D U Y Y ( 1 ) ',3X, 1 ' TDTY (J,l)X ', 1 ,' P A N K Y ( J $1) ' 1X,' X ( I ? T Y ( J . 1 ) ) I/) 10 CALL ? A I'KHT ( D U Y Y , NPTS, IF?) ,- - T : ? T Y ( J , I ) I S ITS!! WHOSE PAYK IS I. ,- - E A Y P Y (J, I) I S E A f H Y I N CESCENDIYG OSCEI; O? R A N K ( A N C VALU::) . DO 16 T = 1 , S ? T S P 4YKY (J, I ) = DU 3 Y ( I P T (I)) T??Y ( J , I ) = I P T ( 1 ) v CI ~r ( N O P E Y T .GT. 9) G C Z C 1 6 i l s r x ~ : o~) ~J ~I ,D , , U ~ Y ( I ) ,rr.?:Y(J,r) , ~ A Y K Y ( J , r ) , ~ ( I P T Y( J , I ) ) 4 P O C Y A T ( 1 H ,T2,1X,I3,1X,P6.2,9Y,T3,4X,F6.2,2X,FS.2) r e 1'5 C C S T 1 !ill?! 17 Ci)Y?IH'JE C I? :YE. (Krl'f 1) C U TC 20 C US33-SrJ?PTJEC EIN/MAXFS, %CT SAVE A N D TZST DATA TC i3E S IJ R5 . SAY ??A'( "Y E A X - - SAVYI:I x r : r ~ S A ' J 7 A Y ) Y E A X S S X 7 5 I ' i =-'i'?IY CCC S C A ! I 3 2 O U C , ? ! T H E DATA G E T T I K G Y I N , ? A X V A L U E : , 7 ?U?P?S? LY 3 I D T C U L I ) I J S FISURES 7 0 X " A K = 1 . 2 - 3 7 u71.i = 1 . E t 37 Y Y A Y = 1 .2- 37 Y Y I N = 1 . s t 3 7 C: 1 'f Z Y O ? I S I N 3 R I ; I N A L O F D Z F , NO? F A N K l f 3 2 I = 1 , N P T S x an:< = A ~ A iU( X Y X Y , x (I)) 2 2 X " T ' I = A.YT'll ( X Y 1'4, X(I) ) Y V 3 L : J Z . S I H R A N K C P D E k I N Z A T B I X , I Y ~ I E S C E N D I S G O i ? C E E , ? H I 2 YYL3 D3 2!1 ,1 = 1 ,:{Y 4 7. Y Y X X = A Y A X l ( 3 A Y K Y (J, 1) ,Y!lAX) 2 3 Y ? T r i = A A T S l ( F A S K Y (J,Y?TS) ,Y Y I N ) -25 1' ( K E Y . Y E . 1) Gc? 'I0 110 i;: 93 3rJ3S:ITUTZ OUI) ? I S / 3 A X F O P U S Z F ' S F E E Y I N C P S E F Y Z D V A L U E I S CiC,CE? Y Y I U = AYI!!1 ( Y ! l I Y , S A V X Y ) Y Y A X = .?:AX1 (YP!AX,SAV!¶AY) I S = 457::11 ( X Y I N , S A V Y I K ) X Y I X = X'AX l(X YAX, S A V Y A X ) 3 ALL O T T T C Y S ? F j l l I a E R A I i S Z S , E U T T S C A L E P A P C H A H G E F I ? r / 3 A K V A L U E S . Z TYZS2 ?G? CC'!PA31S?NS A " I E B Z L C A L E f 1 0 S X V Z I N = X Y I X -. --- S X V ' A I = :: FOE: A?SU!lsNfS Z O / ? F C 3 T S C A L Z C - S 4 Y Y I Y = YYIN S A Y Y A Y = Y Y A X 17 X L I O ? ? L C N S R S Q U I Z Z Z A N G E S S 3Xh';S ?3? X I S A P L U S I S C F Z Y E S T A C Z O S S ?HE ROW C O L e 3Y COS., X L O TC XLII D T F P X = X Y A X - x n m ZX:dr;? =OP. Y I$IINUS INCFElrEHT A C O U H E E C H FgF, I X C Y Y H I 3 Y Y L . 6 S T E 3: 7 S1;U 1'1 ?HE F O L L O R I S G STATERENT. D I E Y = - ( Y ? l A j l - Y Y I N ) 1 (YO_aEi!im .;T. 0 ) Gs TO 1 2 3 W T T 3 ( L Y 8 1 C 5 0 ) X ? l A X , Y 3 A X , X C I N r Y R I N 1 9 5 0 r ~ P . ~ . 3 ? ( 1 3 C ~ , I O x , ~ : i r=A X1,G1S.4,1 Y?!AX = ',G15.4/1H , 1 0 X , 1 X 3 1 h ' = *,- 1 G 1 5 . 4 , ' Y 3 I Y = * , G 1 5 . 4 ) 3 3 T T ' E ( L U , 1 0 5 1 ) i l i F ? X , D I i F Y , KEY 1 2 5 1 ? 0 3 . U , A T ( 1 H 0 8 1 0 X , ' X S P b N . = , G l 5 . 4 , ' Y S F A K = ',G15.4, ' K E Y = ' , X I ) W S I T Z (LW, 1 0 4 3 ) NWID, NU, L E N , F L 1 0 4 9 ? 0 3 , r A T ( 1 A O , 1 O X , ' N W I C , l i k = ',215,' LE6, E L = ' , 2 I S ) C L 1 2 3 - I C ( K E Y .2C. 1 .O3. K B Y .EQ. 2 ) G C T C 14'3 L Z X L L T S C X L Z (%HIN,X?lA:<, X L A E E L , HW,NU?C) " - N O T 2 "AT K F I N , X H A X 2bY 8E X L J U S T Z L 3Y ? S C A L E 1 4 0 S P A N = X Y A X - Xi¶IN - I? .I.?. (S?A!i . 7 E - 1 C ) GO T C 4 3 9 L 1 (V929!4T .GI. 0 ) G 3 3 1 4 1 I F ( X I A X .NE. S A V E A X . X I . N E . s a v n r t i ) * 1 i i 9 I T E ( 1 3 , 1 9 5 2 ) X:!AX, X Y I Y , I 1 C 5 2 F ? ? Y . 9 T ( 1 H 0 , 1 3 Y , 1 S C A L Z C X R h X A N D S C A L E C X i l I N = ' , 2 G 1 5 . 4 ) 1111 3 A N " I X = SPA!4/ ? L C A ? ( ! l k I C ? Y - 1 ) TEST:( = C.5 * SANGEX - 7 Y . 1 .3R. KEY .PC. - 2) GO TO 1 5 0 rC i '< 4!4D Y. P X C X L Z S Y A S T S SA=Tii R I N . ' J A W E S , AKD ' F F E ' X E S U P ' L A B E L S FO? -Z- OP?IC!lSL C O D E Y23Z TO S~~DIN~&?SCAL~ S R X F K A T R l G F T S T C E 9? X A X I S ( X i A b E i (! S E ? S T Y ? . l u 6 P ? . E E L C k FCR Y A X I S . P - S 3 T KZK = 3 IN CALLING PECGRAi? I 3 E X K T 10 S H R I N K G S A P H , E L S 3 - 7 ( K Z Y .EC. 9 ) ;O TO 1 4 6 - -- -- I? ' , A ? S ' ? S Y C ~ S L ~ V Z ~GYEEA'TEP ?HA!i 01; F G U A L T C h'E:i>-TC-LAST X L . \ B E L FL'IS 'I:: L C\'l!:OT S H P i N K . ,- - - ? ( 5 A V " A : c 2 . (XLAEZL ( S i i I D ) + T E S X K J 'GC T C 1 4 t L -" Z L S C 7 5 C A N S!-ii'.iNK Niii3,P C F G Z A C H , AT FIGPI CIiE C f X AXIS IY X E A X CO NOT A F F E C T G F A P H , F . Z V I I 3 D X::IN F O P CLC. ?- CY?.V;?S 9UT YUST U S E ? I ? 5 7 3 3 Z L C i i C - S ? ? ? . WI!: = ! : u I ~ - 1 4 8. Nii = !:YTD 1 S ' d Z L T ? = 5712 * NTEY + 1 -C A3072 C C D ? TC : L I ! ¶ . L A S T A X I S E L O C K i l H E R E X M A X > S A Y t J A U + P L O A T ( N T E N ) * ? 4 5 G Z : i " -1u5 C A L L T S C X L Z (SAVYIY,SXVEAY,PLABEL,KL, L E 5 ) - a 150 S ? h N = - ( S A V Y A Y S A V E L Y ) -I? ( - S P A Y .L3. . l E - l C ) G C T C 4 9 8 0) G3 TO 151 -7 1.- (YSFFY? .;Ti I? ( Y Y T N .HE. S X V Y I Y .CB. Y P A X .NE. S A V F A Y ) 1 V F I T Z (I?,1 0 5 3 ) S A V ! ? A Y , S A ' J P l I Y 1053 ?r)=?lAT ( l H n , l O X , f S C A L E D Y R A X A K D S C A L E C Y Y I Y = ' , 2 G 1 5 . ' J ) C - 151 3 A Y ; Z Y = S?BN / FL3AT(iENGTH - 1) X Z T i T Y = . S * R A Y G E Y C - -- S O 70 ( 2 5 1 , 2 5 1 , 2 4 5 , 2 5 0 ) , K E Y t C O 9 3 3 3EHFINK TSCALE: G B A P H AT'TOP O F Y A X I S ( Y L A E E L ( F L ) ) Y H P E L E Y = 13 2Z3 P A G E , 3 L = L E N + 1 ( F C F Y L A 3 E L S ) P - t RECALL, T S C A L Z Y L X B E L S S T I L L 19 L O W T O F l G H O R L E R 2 0 R ? 4 3 E 'dI'I'-1 T S C A L Z ' S NEXT TO L A S T L A B E L , THE CBSERVED YYAX. t- r b T ? ( Y I I A Z .GZ. ( Y L A E E L ( L E N ) + T E S T Y ) ) GO T C 250 2 u 5 S A V Y I Y = Y L A i 3 3 L ( L E N ) L Z Y = L E K - 1 - L E ! J G T H = L E N * N 3 + 1 " Z C C I F TO? C F BFh2H S H R U F K , h C U L D DO T P I S EEFOBE C A L L P . E V Z ? S , H C d E V E F . N L = L E Y + 1 C 250 CALL 7 E V E P S ( Y S A B E L , H L ) P- C C C N O T I? TCF G," G 3 . 4 P H S H R U N K H U S T DO T H I S BE?OP,Z C A L L REVE3S T F ( K Z Y . Z r ; . 3 ) NL = L E Y + 1 C C C A S O V E ? I L L C H L Y C Z A K G E I N V A L U E 1: L E N H A S E E Z N C I K I N I S H E D C 251 I F (YCPPNT .GT. (3) G C $C 3 C C . # I? (KEY .EQ. 3 ) 1 W ? I T E ( L Y , 1 3 4 9 ) N W I I : , t i Y , L E N , N L - C W 3 I T E ( L W , 1 0 5 4 ) 3A?.r;EX,F A N G E Y , KEY - -1054 ? O ? ' l A ? ( l H c ! , l O X , ' 3 A N G t X - = 1 , G 1 5 . 4 , R A , Y G E Y = 1 K E Y = , T I ) i C G Z Y I V G F E A C Y P O L Y AhC X I A E E L S , T S C A L E ' S A N C C I J E S . = C E r- 3 0 C J Y L B = 0 ' C P3R K 2 Y = 1 0 3 = 2 C-- 4E23 3 9 I G I N X L , 095E?VED Y Z A X FOR Y H T = E E L O Y . S E E .ZLSC), S T . 1 1 9 A E C V t .-.- I = K Z Y P = 3 C P = 4 X Y T S= X E I N P O S S I ~ L Y R E V I S E I :E Y T S C A L : Y ! i I = S A V Z A Y T ? K .EC. 3 . r ) ? . K Z Y .EQ. 4 ) G O TC 3C6 c C =0,9 K Z Y = 1 C3 2 , SET X L A E E L 5 H E R E X L A B Z L ( 1 ) = X d I N D O 305 I = 2,SW IYl = I - 1 t-' t4 b 4 a P1 c4 0 t-I z! & a 3 F ' L, 7: 7. H 4 m m Z H W k I ffi 0 0; - P b U lLI . w - 14 Id 3 Ln 0 . CI H 4 U - -w 1-1 ru 3 x rn -- - cl* - Q kc O m .=: n - rffi - 7. r 0 W U u I- c7 r-l - n t-* - 4i 4 W I t' u IJ. 7 H f 4 C; H E- w cr. x - w w f f i w -. l D J II - [IL W W 4 X a, r 4 Y V1 E-4 ffi t) a a - C3 1. * O w a m = - 4 l-4 z x -4 l C3 o r * * \D W r, - - H Z a d U a LU I I N W H v r x 4 - - n.8 tn 4 % t-4 Hffi- x P-4 r d u x U I F 3 - Y. I4 -1 CS .a w \ x 4 -- cl, w x: U; -a - v . Z Z b 4 0 4 - 3: r~ x Z o - 14 -1 t-( 9 a-· 0 r a m - -. I 3 14 a II) W 1J --= I-I x F Z X H + rl+ m - m n l c ~ a 5l 7. w 7 , - * - -7 \ 3r tx n M - % ,*.:TT: h1 0 * n > d m 0 ! 4 3 0 - a l 14 r.l 0 p 0r a O F \ *-l- 0 0 a- C * S H O ' \D rl-- w o c-l 7. v; \n ax 4 7. x u.3 3 ax- 3-t' . x-rJ)C: *+I=- P-4 - % (I: I1 d ' m x - W U + a U 't4 3 'F' r: w, -77-k 4 4 p 4 X =q 4 Y7 n Ql El r: t 4 4 0 w r 7 . - - t - 4 r# a. C! I a. rn -. f.-4 s7 m - H C f r r r . p O w a c t ; ~ ~ r - ~ ~ ~ u 0 w . c H x r 4 z 7 - x C 4 r N m C C I 0 I? ( J ? O i l .GT. 1 ) P H I = YHI + FANGEY DO aoo J = l,.un N ' d A f C ? ( 1 ) = .YjABK(J) T T ( J ? O U .EQ. 1 ) L O 1 ( J ) = 0 !iU Y 1 = L C 1 ( J ) + 1 I?UY1 ( J .;T. N ? T S ) N u n 1 = NPTS DO 603 T = Ni131, Y P T S RPCALZ, F A Y K Y ' S ALliEAtY I N D E S C E N D I X G C A D E S , a I G H T O LCZ. - z x . 4 L L, D I P Y = - (YMAX - Y n I x ) IP(3AYIC.Y ( J , I ) . G 7 . ( Y H Z - TESTY) . C S . 1 ? A V K Y (J,T,) m L 5 . ( Y H I + T E S T Y ) ) GO 'TO 700 L3T ( J ) = I AT '233 START OF EACH NEii RCU, F I R S T C C L U P H X 5 0 = X n I Y D3 550 3 C O L = 1 , N W I C T H CCL'JYN 9Y CCIUYH ? O S I T Z Y E I N C R E H E N T F O R X. I ? (NCOL .GT. 1 ) XLO = XLO + R A N G E X T? ( X (IPTY ( J , I ) ) . L I . ( K L C - T E Z T X ) . C S . 1 X ( I ? T Y (J,I)) .GE. ( X L O + 'IESTX) ) GO TO 550 C C H Z FiA'fE A FCIHT CCC F U S T P I Y C A N Y A N D ALL T I E S FOR THIS ( J R C Y , N C C L ) J L ( N C 3 L ) = J L (NCOL) + 1 C TT 7 0 3 2 TEAK Y I Y E T I E S , YE H A R K TEE EB/Pf! VITt! A Z E E C (C) I ( J L (::COL) .GT. NINZ) J L ( H C 0 L ) = 1C - L i !I3 (NCCL) = 1.I WATCH ( J L (YCO 5) ) k 550 C C N T I H U E C . 6 3 0 C C N T I N U E C ~ C I ) C O ! ! T ~ Y U E c - - - -c N O Y , T O ? P I N T THIS L I N E C E E L A N K S A N D / O F M A R K S , WIT H A P P P . C P ~ ~ I A TYL.15rI.C E A N C / O 3 Y AXIS H O T A T I O H . .+ C J J R I S SET A3QVZSSTYT. 5 1 2 A S O V 3 FOP + C P I AT CTAZT CF ZAC!! ECW. . T F - 6 ( J J P . Y E . 1 ) 5 0 TO 9 8 2 C J Y L B I S ALS3 SET A B C V E SlnT 5 1 2 ABOVE. r, I T (KEY G O . 1 .OF. K E Y .EL, 2 ) Y L A E E Z ( J Y L 0 ) = YEI, rn h " ? T E ( L i d , 9 9 5 ) Y L 4 B E L ( J Y L E ) , L R C f l A (JJR) , ( L T Y Z ( K ) , \ = I , NUI!>Tri, , I L ? c ; l a ( J J ~ ) 9 9 5 F O F ' I A T ( 1 Y , l ' X , G 1 5 . 4 , A 1 , 1 0 1 A l . A 1 ) C ;9 TO 1000 ,- k 0 . 3 2 il!:Z?E ( L U , Q I ! 3 ) L R O ; I A ( J J F ) , ( L I H E . ( N ) , Y = l , : J Y l C T ! i ) , L ? r J d A (JJ3) 983 ? ( 1 , 1 6 X , A 1 , 1 0 1 X l , A l ) C C C C 5!1D 3: A 507 IN 31; LC)@?, DC 1090 J 9 C d = 1, LENGTH C I i I 1 C 0 3 Z C S T I N I I E c 51. >.LL 9 9 7 s P L O Y T Z D , !ICY X A X I S A N D XLABELS P R I Y T E C AT BCTTCY 31 G R A P E m i I ? I T E ( L Y , 6 3 1 0 : ( ( L C O L A ( K ) . K = 1 , 3 ) , ! 7 = 1 , 6 Y 2 3 ) P - C W I L L TAE X L A S Z L S ? I T I N 10 PIAX. S P A C E S ? ? 7 CANI.IOT K Z E P LABSLS I K ~ 1 1 . 4 "OREAT IF ICFK = c I C H K = C I C h 5 2 = 0 .LT. D 3 9 5 0 1 = 1, F i I? (A35 (XLAESL (I)) 0.1 I C H K 2 = I C H K 2 + 1 -7: ( A s S ( X L A Y Z L ( i ) ) E 1 0 0 0 0 . 0 ) I C H K = 1 3 5 c c n ! ~ ~ I y u F -: - - ( I T f l K 2 .GE. 2 ) I C H K = 1 I? (ICHK .IQ. C) GC TC 953 Z NO" dZ PSI!;? ?t!2 XSABELS CN T S O L T N E S T Y A S I A G G E I I E C E l i . ;iF!ITF(Lk', 6 0 1 I ) (!LABEL ( I ) ,I=1,NU, 2) 61311 ? t 3 R Y A T ( l B , 4 X , 6 ( 9 X t G 1 1 . 4 ) ) k ' 2 1 T E ( L a ,60 1 4 ) ( X S A E E L ( I ) , 1=2, N W , 2 ) 6014 ? O X 3 A ? ( l H , 1 4 2 ; , 6 ( 9 X , G 1 1 . 4 ) ) G O TO Q 5 U 953 , C 1 ) ( X L A B E L ( I ) , I = l , N ' r l ) - 5 0 1 3 3 0 R Y ; \ T ( 1 H , 1 1 X , 1 1 F 1 @ . 4 ) " 3 5 4 COII"IflUE, CCC C ) Y R G ? A P H I S CC!l?LETED C C 6 3 S H O I GFAPH :J;)TATIONS P C R EACH C? U F C 5 S I S L E II'S ( W H E N NO T I Z S ) . C ; r 3 I T P ( L F , 6 0 0 5 ) ( J , Y R A R K ( J ) , J - 1 , 4 ) C 6 3 2 5 ?QF! Y A 7 ( I H 3 , 6X, 4 ( l Y ( ' ,'I I t 1 ) I S ' , A 7, 3 3 ) 1 " C GO 9 9 9 CCC c *** E R F O R ?IECSA;E: F E T U F N S * * * P i 1 9 9 ZC!ITINUE --&-#L*::-?- ~ .= 1 9 8 ? O R , ' I A ? ( l I E ( L W , 1 9 5 ) iENSTH,NilIDTH,HY,N?TS,FEY 1 9 5 F ' 3 Q ? l A T ( 1 H 0 , 1 C A L L I N G SEQUEHCE E R E O R I N C A L L ? C L C ? ' / 1 1H , ' S ? E C I ? I E D LENGTH = ' , I l l / . U 1 % C 7 3 A l . 4 F O I S T S = l v I 1 l / 5 1'3 ,lCP?TC)N C 3 3 Z 1 , K E Y = ' , I 1 73 I" (LW, 1 9 F ) C;r q 30 Tr, 3 0 9 - u?r?z.&Lw,1 9 9 ) ~ s I T E ~ L w 4, 9 5 ) S X V 3 A X t S A V r ! 1 N , X : ! A X , X H I Y , E I F F ~ ~ O R ~ A " ; ( ~ F I C , ' E O R R C I) RN S P A S ' , 'SAVFAIY = ,I I , 1 P E 1 2 . 3 , I S A V Y I Y = P E f 1 3 , ' x ~ , , X= 1 , 1 P E 1 0 . 3 , 1 X n I N = I , 1 P E 1 0 . 1 . 1 D I F P = I , l P ? l O . ? / ) 1 WRITE ( I N , l Q 8 ) ;;3 TO 999 Y 3 I T E (LW,1") WEIT!? (LW, 4 9 6 ) Y t : A X , Y H I S , S A V 3 A Y , S 2 , V 7 1 Y , I : I c F Y ? 3 R . Y A T ( l H 0 , ' 2 , i E 3 2 I N S P A N , Y Y A X = ' , ~ 1 5 . U , ' Y E 1 3 = ' , 5 1 5 . u , 1 ' S A V Y A Y = ' , G 1 5 . U t 1 SAVtlTY = f , G 1 5 . U , ' C Z F F ' I = ' , G 1 5 . 4 ) i 3 I T P , ( L W , 1 9 9 ) ' 9 TIJ 9 11 5 2. E!l D S113?.CU;'I3Z FANF"T ( Y , NPTS,IP'X) t X F.EYT-STON C F A ha^.,. L O U TO HIGH ROUTINE B Y LA9FY FI. WESTPHAL. r S U B . 3 3 Y K H I YIELDS RASKIKG FhC3 HIGH TO LOW OF IT2PS EPISZD C N VECTOR Y VA. C I B K ( I ) I S SPIHK OF 1 " I H ITEH 2 I P T ( 1 ) I S TIiE LTE!I WHOSE R A N K I S I z 2/13/15 , S U B . PLOT DOES NCT UTIIIZE T B P - R 3 I L 19s L P - SINCS X A X . N?TS 190, DIREHSION ITY ( 1 9 0 ) , IRK (100) 2/19/75 L D I I Z S 5 1 ' - . Y ( ? I T S ) , I P T ( H P T S ) , b R K (10C),ITY (10C) D O 2 I = I ,N?TS I R K ( 1 ) = D.0 2 I P T ( 1 ) = 0 1 = 1 14 z - 1 O C O :CO. 0 L T = 0 IY = 0 DO 20 L = 1,h'PrS 2 (1 ITY(L) = 0 DO 10 L = 1 , HPIS 7 - ,: (IPK(L) .HZ. 0.0) GO TO 10 IF ( R - Y ( L ) ) 11,12,10 1 1 I.: = L ? = Y ( L ) I1 = 0 DCI 2 1 L1 = 1,NPTS 2 1 I T Y (51) = 0 G O TO 10 12 I Y = I Y + ! I ( I ) = L 10 CC YYYIJE I ? ( L T .EQ. 0) GO TO 998 R1 = 7L3AT [ I ) + (?I.OAT(IY) ,' 2.0) I SK ILT) = F I I P T (I) = LT , t I? ( I Y .?!a. O f SO TO 22 D3 2 3 L 1 = 1 , If I ~ K ( ~ 1 ) ) = ;I I = T + l - 2 3 IP"1) =. I"(L1) '9 - L 2 2 - - I = I + 1 IF (I .LE. NPTS) G O TO 1 4 Gr) TO C"9 a 656 19i TE ( 6 , 957) I q97 73iiYAT (1H0,9ti***x*R***/1Y ,IE3FCR I N FAKI(FiI1/, 1 1 x , 3 H * * * * * f " * / ; - 999 3 5 T V Q Y E 'ID SilB FOOTINS EEVE9S (YLABEL,NL! CCC Wil32E Y L A B E L S ?R"IX TSCALE A R E T H A C C E S L T " ; , . F A T H E 3 ? H A Y D.?SCEN3IS?, C ? L r C C OF 7ALO 2 , CALL 3ZVERSE ( Y L A E E L , N?) CCC WOQTS FOR UNYATCHED PAIRS A Y E L L AS ? A T ; Y E I : PATEIS, S I Y C Z C Z N T 3 JL C C i E CCC STAY PllT. C J F I T Y E N S P A I N G 1 9 7 5 , A A N / C R . 31 *'r: KS I C . l Y L A B Z L (3L) YTZST Y L / 2 K = Y L - I 5 3. S173 = YLABE!,(J) YL 133L (J) = Y L A S Z L (K) YC.A3,>L ( P ) = SBV3 3 4 9 C 3 Y I I Y U E RXTLJ3Y E!jD S U 9 7 0 U f z Y 3 I S S A S Z (VEIS, V E A X , V S C A , Y C I J , N A X I S ) '3 S U S R O i l ? I S 3 T O S C A L E A ?LOT. C V S I Z 3 N BY 3. . 3 , UNZV. GF HAEZYLANt, 1 9 7 C . R E V I S E D 2/75 S R / A A Y C T Y Z I Y ? U ? V A ? I A 3 L E S "315 A N 3 7FAX C C 3 T A I Y :HZ CBs2!?VE3 VALUES CT tlIHI.IUIl/flAXIYU?I 2 VALUES O? T H E VAaIAalE TO E E SCALZD. ON CUTPOn,.THEY Y I L L :CONTAIN 7'AE ADJUSZE3 VALUES TC EE USED ?OVNIL,O' HUFFERS r3 ALCY'; T?E AXIS Or" TA': ?LOT. C VSCX I S 3 s A3EAY WHICH S I L L C C b T A I S A X 1 5 IACESC. N I X I E I S C ?!!E NUZ32R O F AXIS 3 L O C K S , SO TEAT THEP= K T L BE 'NAXIS+1' C EHTSI"; YADE IY VSCA. ,- - 1Y5I.Y. = S A X I S + 1 DI!IZ!4SION VSCA(SCI!!) 8 X S C ? ( 1 2 ) DATA XSC?/C., 1.. 1 . 2 5 , 1.5,2. ,3., 4. ,5. ,6. ,7.5,8., 1 C . / NLOOF = C . S P A N = 0.0 YSSF = 12 N 3 Y 1 = NSCP - 1 Z Z F C , = V ~ T N E?0 S z F = (VflAX - V!lIs) / FLCAT (SAXIS) Y I S 5 I G = i S I G N ( 1 ? I X (Vfl.IH) ) DX1=O. 17 (SC? .LE. 0.0) GO TC 12C X!4C=XLOGlO ( S C ? ) INC=X!iC I ? ( X . U C . L Z . O . ) I J 2 = i ! I C - 1 I I ( I N C . G ' I . 0 ) X N f 1 0 = 1 0 . * * I N C I? (TNZ.LE.0) X S : ? @ = - ( l @ . * * A E S ( ? L O A ? ( I V C ) ) ) D X = I S C A L E ( S C F , - X Y C 1 @ ) DO 6 5 1 T S C = 1 , Y S n 7 651 I i ( D X . S T . X S C ? ( I S C ) ) C X l = X S C F ( I S C t l ) C A P F O a A 3 L S SYALL ?XCTCF HAS EEEK CCUPU'IEC. LET US C N3Y 23Y 70 F I N D A YINilS1Utl. ('THIS COD5 IS T A K E 3 CP C ' l I X X , Y U 3-,DINCINr;.) 4 D:< 1 =?SCF.LS(CX 1,XYC1.3) !IEA?aY= l+!!T:iSIG+IPIX (ALS (VZI!:) / E X 1 ) - V 7 7 N==LOAT (!JtX38Y) * E X 1 - ' 2 8 C J Y T I ! I U E 'i - I? ( V 3 X N . LE.Zi:,>.C) G O Trl 1 2 9 - i 'f YI N=V 31 N-D1 1 C GO V '28 E !P - 1 2 7 ZO!JTINUE I S P A Y = V Y I N + ? S O A T ( H A X I S ) * D X 1 I7 (SPA f:.GZ.VIrAX) L C TO 6 U 9 C W E H A V ? 7 O V E 3 THE !lIl:I!5U,L! D O k S SO FA? T E b T THE ? K C F E r F S y C D O E S N ' T U O 2 K 4 Y Y 3 C 3 Z ) S L Z C F = S L C C F + l 17 !9LOT)P.L.E.L) GO TC 6 5 0 1 2 0 Y ? I T Z ( 6 , 1 2 4 ) 1 2 4 C O 5 5 A T (IHC,9Fi"*******/lH ,I E R F C S I!i TSCALE F C O T S N E I / . 1 * q y + * * - - = - - * / 1 6 4 9 CDKTI'JrJE D X = D Y 1 PY AX- SFAK D O 6 5 5 IH = 1, Y32H Y S Z A (13) = V3IH + TLOAT (IH - 1 )* D X 555 C3YTINUE 5ZfU';X - 3 ?7!?Ct13K i?SfALZ ( Y bh T I S , CHAE AC) f FU YCTTCN TC SCALE E'i E X P O Y E N ' I I A L SCALE ?ACTCR Z i l R I 7 X E BY -r F.K. E213, U S I V . OF YARYLASE, 1 9 7 0 . 3 A L YANTTS I ?(CHhPXC.ST. 0) ?SCALE=RAHTIS*CRAIi IC I? (CHARAC. L?. 6) PSSAL2=HAHTIS/AES (CHAFPC) 3Z"UFN ZYD X d e l ~ a n ,I., and S . Xobinson, Income D i s t r i b u t i o n P o l i c y i n Developine Countries: A Case Study of Korea,(Stanford: S t a n f o r d L n i v e r s i t y P r e s s , 1976 Eorthconing). X i t c h i s o n , J., and J.A.C. B r o m , The Lognormal D i s t r i b u t i o - , (Csnbricfge: Cambridge U n i v e r s i t y I r e s s , 1957). Arden, B.W., and K.N. A s t i l l ,S u m e r i c a l A l g o r i t h n s : O r i g i n s and A p p l i c a t i o n s , ( k z d i n g , Yass: Addison- Wesley, 1970). J a r a t t , P . , "A Review of Methods f o r S o l v i n g Yon-Lfnear A l g e b r a i c E q u a t i o n s i n One Variable," i n P. Rabinovitz, e d . , Numerical Xethods f o r Yon- L i ~ e a rA l g e b r a i c E q u a t i o n s , (London: Gordon and Breach, 1 9 7 0 j . Ker.dall, !-i.G., and A. S t u a r t , The Advanced Theory of Statistics. V o l m e 1: Distribution Theory, 2nd edicion, (New York: iiafner P u b l i s h i n g Conpany, 1963). Robinson, S. , and K. D e r v i s , "Income D i s t r i b u t i o n and Socio-Zcorionic X o b i l i t y : An Approach t o D i s t r i b u t i o n P l a n n i n g , " Prinlzeton U n i v e r s i t y , Research Program i n Development S t u d i e s , D i s c u s s i o n Paper #&9, Xodgers, G . a . , X . J . D . Hopkins, and R. Wkry, Economic - Denocra?hic X o d e l l i n e -f o r ~ e d e l b ~ n e nPtl a n n i n g : Bachue P h i l i p p i n e s , (Geneva: I . L . O . , f o r t h c o n i n g 1976). - . s e n , A . K . , On Econcmlc I n e q u a l i t y , (Nev York: Yorton, 1973). rS fizal , K. , and S. Bcbinson ,"Measuring Incone I n e q u a l i t-i,"i n C . 3. F r a n k Jr. * I I a n d 3. Webb, e 2 s . Incoce D i s t r i b u t i o n : Polic:; Alterxacl-;es l n DeveP,-?ix~ - - ThorSecXe, t., and J.K. Sengupta, "A C;nsistexcy - r r2zer;orX f o r rz?lo>-xer.r, O u t ~ u taad Incocc Distribution: ? i o j e c : f s n s Applied t o Co;sz3ia," C e r e l o ? z e n t 2 e s e a r c h C e n ~ e r ,The World Bank, 1 9 7 2 .