spCdf: (Weighted empirical) cumulative distribution function

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Compute a (weighted empirical) cumulative distribution function for survey or population data. For survey data, sample weights are taken into account.

Usage

1
spCdf(x, weights = NULL, approx = FALSE, n = 10000)

Arguments

x

a numeric vector.

weights

an optional numeric vector containing sample weights.

approx

a logical indicating whether an approximation of the cumulative distribution function should be computed.

n

a single integer value; if approx is TRUE, this specifies the number of points at which the approximation takes place (see approx).

Details

Sample weights are taken into account by adjusting the step height. To be precise, the weighted step height for an observation is defined as its weight divided by the sum of all weights.

If requested, the approximation is performed using the function approx.

Value

A list of class "spCdf" with the following components:

x

a numeric vector containing the x-coordinates.

y

a numeric vector containing the y-coordinates.

approx

a logical indicating whether the coordinates represent an approximation.

Author(s)

Andreas Alfons and Stefan Kraft

See Also

spCdfplot, ecdf, approx

Examples

1
2
3
data(eusilcS)
cdfS <- spCdf(eusilcS$netIncome, weights = eusilcS$rb050)
plot(cdfS, type="s")


Search within the simPop package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.