weighted.var: Weighted Variance

Description Usage Arguments Details

Description

Returns the weighted variance of a vector. A numeric vector and its weights must be provided.

Usage

1
weighted.var(x, w = NULL, xLoc = 2, wLoc = 3, na.rm = FALSE)

Arguments

x

a numeric vector. Alternatively, x can be a matrix-like object that includes data for the vector and the weights.

w

a numeric vector of weights.

xLoc

if x is matrix-like, this specifies the column containing vector information. Can be the column number or name.

wLoc

if x is matrix-like, this specifies the column containing weight

na.rm

if True, remove NA's from data. Default is False information. Can be the column number or name.

Details

For 'tapply' or 'by' compatibility, the function can take a matrix or data frame as long as the vector and weight column locations are specified.


mnblonsky/REMI documentation built on May 23, 2019, 5:06 a.m.