Learn R Programming

surveybootstrap (version 0.0.3)

weighted.mean: 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)

Value

The weighted mean

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.