sdWeighted: Calculate weighted standard deviation of a vector.

Description Usage Arguments Value See Also Examples

Description

Given a numeric vector (x), the corresponding vector of weights (weights) and the weighted mean of x (weighted_mean), calculate the weighted standard deviation of x.

Usage

1
sdWeighted(x, weights, weighted_mean)

Arguments

x

The numeric vector for which the weighted standard deviation is to be calculated.

weights

A vector of the same length as x giving the weights.

weighted_mean

The weighted mean of x, perhaps calculated using weighted.mean.

Value

A numeric vector of length 1 giving the weightyed mean of x.

See Also

weighted.mean

Examples

1
2
3
4
x <- rnorm(10)
wt <- runif(10)
mn <- weighted.mean(x, wt)
std <- sdWeighted(x, wt, mn)

SEEG-Oxford/seegSDM documentation built on May 9, 2019, 11:08 a.m.