weightedMean: Calculates weighted mean.

Description Usage Arguments See Also

Description

Computes a weighted mean of a numeric vector.

Usage

1
  weightedMean(x, w, na.rm = TRUE)

Arguments

x

a numeric vector containing the values whose weighted mean is to be computed.

w

a vector of weights the same length as x giving the weights to use for each element of x. Negative weights are treated as zero weights. Default value is equal weight to all values.#

na.rm

a logical value indicating whether NA values in x should be stripped before the computation proceeds, or not. If NA, no check at all for NAs is done. Default value is NA (for efficiency).

See Also

as.surveyorStats

Other "central tendency functions": weightedCount, weightedMedian, weightedSum

Other stats helper functions: allNA, allNull, is.yesno, qType, reorderQuestion, reorderResponse, splitBinCombine, splitMeanCombine, splitPercentCombine, weightedCount, weightedMedian, weightedSum


andrie/surveyor documentation built on May 10, 2019, 11:21 a.m.