Description Usage Arguments Value Author(s) Examples
This function is to compute an unbiased sample weighted variance.
1 | weighted.var(x, w = NULL)
|
x |
A vector to compute a variance, var(x) |
w |
A weight vector |
Returns an unbiased sample weighted variance
Yujung Hwang, yujungghwang@gmail.com
1 2 3 4 5 | ## If you do not specify weights,
## it returns the usual unweighted sample variance
weighted.var(x=c(1,3,5))
weighted.var(x=c(1,3,5),w=c(0.1,0.5,0.4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.