sd_wt | R Documentation |
Calculates the standard deviation of a weighted sample set while propagating sample weights through the calculation.
sd_wt(x, w, na.rm = FALSE)
x |
Vector containing the values in the set |
w |
Vector containing the weights to each value (in
the same order as |
na.rm |
Should NA values be removed from the set prior
to calculation? |
The standard deviation of the weighted set of x
values
# Create dummy data x <- seq(1, 10, 0.5) w <- c(seq(0.1, 1, 0.1), seq(0.9, 0.1, -0.1)) SDw <- sd_wt(x, w, na.rm = TRUE) # Run the function
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.