weighted_mean {twangMediation}R Documentation

Calculate a weighted mean.

Description

weighted_mean calculates a weighted mean, given a vector.

Usage

weighted_mean(x, weights, multiplier = NULL, na.rm = TRUE)

Arguments

x

numeric The the data set

weights

numeric The weights

multiplier

An additional vector to multiply Default : NULL

na.rm

Whether to remove NA values. Default: TRUE

Value

numeric The weighted mean of the data.


[Package twangMediation version 1.2 Index]