WeightedMean: Computes Weighted Mean

Description Usage Arguments Examples

Description

Compute the weighted mean of data.

Usage

1
WeightedMean(x, weights = NULL, normwt = "ignored", na.rm = TRUE)

Arguments

x

a numeric vector.

weights

a numeric vector of weights of x.

normwt

ignored at the moment.

na.rm

a logical, if TRUE, missing data will be dropped. If na.rm = FALSE, missing data will return an error.

Examples

1
2
3
4
x <- sample(10,10)
w <- sample(5,10, replace=TRUE)

WeightedMean(x, w)

SciencesPo documentation built on May 29, 2017, 9:28 p.m.