weighted_se: Weighted standard error

View source: R/ses.R

weighted_seR Documentation

Weighted standard error

Description

Computes a weighted standard error of a vector or matrix.

Usage

weighted_se(x, w, na.rm)

Arguments

x

A numeric vector or matrix. For matrix, standard errors are computed for each column

w

A numeric vector of non-negative weights. Will be automatically normalised to sum to one.

na.rm

If TRUE, NA values in x (and corresponding weights in w) are omitted from the computation. Default is FALSE.

Value

A weighted variance.

Note

Compared to some other R functions, here the weights are regarded as probability weights, not frequency weights.


diagis documentation built on Sept. 8, 2023, 6:13 p.m.