weighted.ecdf: A weighted ecdf function.

Description Usage Arguments S3 methods See Also Examples

View source: R/weighted-stats.r

Description

An extension of the base ecdf function which works with weighted data.

Usage

1

Arguments

x

numeric vector of observations

w

integer vector of weights, representing the number of time each x was observed

S3 methods

The ecdf class has methods for plot, lines, summary and quantile. quantile does not currently correctly compute values for weighted ecdfs.

See Also

weighted.mean

Other weighted statistics: weighted.quantile; weighted.sd, weighted.var

Examples

1
2
3
4
5
6
7
8
9
x <- runif(200)
w <- rpois(200, 5) + 1

e <- weighted.ecdf(x, w)
plot(e)
summary(e)

y <- x[rep(seq_along(x), w)]
plot(ecdf(y))

hadley/bigvis documentation built on May 17, 2019, 9:45 a.m.