wtd_sd: Compute weighted standard deviation.

Description Usage Arguments Value Examples

Description

Compute weighted standard deviation.

Usage

1
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

1
2
3
4
5
6
## 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 Aug. 31, 2021, 4:25 p.m.