Skip to contents

Computes the population weighted skewness (Fisher's g1): sum(w_hat * ((x - mu) / sigma)^3).

Usage

weighted_skewness(x, w, na.rm = FALSE)

Arguments

x

A numeric vector of observations.

w

A numeric vector of non-negative weights (need not sum to 1).

na.rm

Logical. If TRUE, paired NAs in x and w are removed before computation. If FALSE (default) and any NA is present, NA is returned.

Value

A single numeric value.