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 : |
na.rm |
Whether to remove NA values.
Default: |
Value
numeric The weighted mean of the data.
[Package twangMediation version 1.2 Index]