weighted.sd | R Documentation |
This is a basic weighted standard deviation function, mainly for internal use with sumtable
.
weighted.sd(x, w, na.rm = TRUE, type = "frequency")
x |
A numeric vector. |
w |
A vector of weights. Negative weights are not allowed. |
na.rm |
Set to |
type |
The type of weights to use. The default is |
x <- c(1, 1, 2, 3, 4, 4, 4)
w <- c(4, 1, 3, 7, 0, 2, 5)
weighted.sd(x, w)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.