weighted.mean: Compute the weighted mean

View source: R/helper_functions.r

weighted.meanR Documentation

Compute the weighted mean

Description

Given a vector of values and a vector of weights, compute the weighted mean

Usage

weighted.mean(x, w, na.rm = FALSE)

Arguments

x

The vector of values

w

The vector of weights

na.rm

if TRUE, only consider elements of x that are not missing (and their corresponding entries in w). Defaults to FALSE.

Value

The weighted mean


dfeehan/surveybootstrap documentation built on Feb. 3, 2023, 6:52 a.m.