weighted.sd: Weighted Standard Deviation

Description Usage Arguments Value Examples

View source: R/weighted.sd.R

Description

Computes the standard deviation of values in x using weights.

Usage

1
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

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

tpetzoldt/antibioticR documentation built on Sept. 25, 2021, 1:17 p.m.