Description Usage Arguments Details
Returns the weighted variance of a vector. A numeric vector and its weights must be provided.
1 | weighted.var(x, w = NULL, xLoc = 2, wLoc = 3, na.rm = FALSE)
|
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. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.