Learn R Programming

diagis (version 0.2.3)

weighted_se: Weighted standard error

Description

Computes a weighted standard error of a vector or matrix.

Usage

weighted_se(x, w, na.rm)

Value

A weighted variance.

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.