wt.summary: Weighted mean and variance

Description Usage Author(s) Examples

Description

produce weighted mean and variance estimate from a numeric vector of values and weights. This function is from the R mailing list at https://stat.ethz.ch/pipermail/r-help/2008-July/168762.html

Usage

1
wt.summary(x, w, na.rm = FALSE)

Author(s)

Gavin Simpson

Examples

1
2
3
4
5
6
## from example section in ?weighted.mean
## GPA from Siegel 1994
wt <- c(5,  5,  4,  1)/15
x <- c(3.7,3.3,3.5,2.8)
summary(x)
wt.summary(x,wt)

tlamadon/rutils documentation built on May 31, 2019, 3:49 p.m.