sd_wt {ShellChron} | R Documentation |
Function to calculate weighted standard deviation
Description
Calculates the standard deviation of a weighted sample set while propagating sample weights through the calculation.
Usage
sd_wt(x, w, na.rm = FALSE)
Arguments
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? |
Value
The standard deviation of the weighted set of x
values
Examples
# 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
[Package ShellChron version 0.4.0 Index]