Learn R Programming

IC2 (version 1.0-1)

curveConcent: Concentration Curve

Description

Plots a concentration curve.

Usage

curveConcent(x, y, w = NULL, xlab = NA, ylab = NA, add = FALSE, grid = 0, ...)

Arguments

x
Numeric vector with non-negative values.
y
Numeric vector used for the ranking of vector x.
w
Numeric vector of sampling weigths (optional).
xlab
Title for the x-axis.
ylab
Title for the y-axis.
add
If add is TRUE, only the curve is drawn. The device must contain a high-level plot.
grid
If grid >0, a grid is drawn, with spacing equal to 1/grid.
...
Further arguments to be used for drawing the concentration curve (see lines).

References

O'Donnell O., van Doorslaer E., Wagstaff A., Lindelow M. (2008) Analyzing Health Equity Using Household Survey Data. World Bank, 220 p.

See Also

calcSConc

Examples

Run this code
data(hhbudgets)

curveConcent(x=hhbudgets[, "transporte"], y=hhbudgets[,"ingreso"], w=hhbudgets[,"factor"], col="red", xlab="Ranking by income")
curveConcent(x=hhbudgets[, "mantenimiento"], y=hhbudgets[,"ingreso"], w=hhbudgets[,"factor"], col="blue", add=TRUE)
curveConcent(x=hhbudgets[, "publico"], y=hhbudgets[,"ingreso"], w=hhbudgets[,"factor"], col="green", add=TRUE)
title(main="Transport expenditures")
legend("topleft", legend = c("All transport", "Private: Maintenance and repair", "Public transport"), col=c("red", "blue", "green"), lty=rep(1, 3))

Run the code above in your browser using DataLab