Description Usage Arguments Details References See Also Examples
plots Pen's Parade of a vector x
1 2 3 4 |
x |
a vector containing non-negative elements. |
n |
a vector of frequencies or weights, must be same length as |
group |
a factor coding different groups, must be same length as |
scaled |
logical. Should Pen's parade be divided by |
abline |
logical. Should a horizontal line for the mean be drawn? |
add |
logical. Should the plot be added to an existing plot? |
segments |
logical. Should histogram-like segments be drawn? |
col |
a (vector of) color(s) for drawing the curve. |
fill |
a (vector of) color(s) for filling the area under the curve. |
xlab,ylab |
axis labels. Suitable defaults depending on
|
main, lwd, las, ... |
further high-level |
Pen's Parade is basically the inverse distribution function
(standardized by mean(x)
).
Pen
allows for fine control of the layout—the graphical parameters col
and fill
can be vectorized if histogram-like segments are drawn
(segments = TRUE
)—but implements several heuristics in choosing its
default plotting parameters. If a grouping factor group
is given,
the default is to draw segments with a grey-shaded filling. If no fill color
is used, the default is to draw a thick blue curve. But as all of these are just
defaults, they can of course easily be changed. See also the examples.
F A Cowell: Measurement of Inequality, 2000, in A B Atkinson / F Bourguignon (Eds): Handbook of Income Distribution, Amsterdam,
F A Cowell: Measuring Inequality, 1995 Prentice Hall/Harvester Wheatshef,
J Pen: Income Distribution, 1971, Harmondsworth: Allen Lane.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # load and attach Philippine income data
data(Ilocos)
attach(Ilocos)
# plot Pen's Parade of income
Pen(income)
Pen(income, fill = hsv(0.1, 0.3, 1))
# income distribution of the USA in 1968 (in 10 classes)
# x vector of class means, n vector of class frequencies
x <- c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261)
n <- c(482, 825, 722, 690, 661, 760, 745, 2140, 1911, 1024)
Pen(x, n = n)
# create artificial grouping variable
myfac <- factor(c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3))
Pen(x, n = n, group = myfac)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.