This is a basic weighted standard deviation function, mainly for internal use with sumtable
. For a more fully-fledged weighted SD function, see Hmisc::wtd.var
, although it uses a slightly differend degree-of-freedom correction.
weighted.sd(x, w, na.rm = TRUE)
A numeric vector.
A vector of weights. Negative weights are not allowed.
Set to TRUE
to remove indices with missing values in x
or w
.