Computes the standard deviation of values in x using weights.

weighted.sd(x, w = rep(1, length(x)), df = sum(w) - 1)

Arguments

x

numeric vector of data

w

numeric vector of weights

df

degrees of freedom

Value

scalar value

Examples

x <- c(1.5, 4.1, 3.7, 8.2) w <- c(4, 5, 4, 1) weighted.sd(x, w)