wtd_sd: Compute weighted standard deviation.

wtd_sdR Documentation

Compute weighted standard deviation.

Description

Compute weighted standard deviation.

Usage

wtd_sd(x, weights = NULL, na.rm = TRUE)

Arguments

x

A numeric vector.

weights

A numeric vector of weights.

na.rm

Set to FALSE to suppress checking for NAs

Value

Returns scalar vector of length one.

Examples

## Not run: set.seed(1)
         x <- runif(500)
         wts <- sample(1:6, 500, TRUE)
         mn <- wtd_mean(x = x, weights = wts)
         sd <- wtd_sd(x = x, weights = wts)
## End(Not run)


gerasy1987/usefulr documentation built on Sept. 18, 2024, 9:46 a.m.