Skip to contents

Calculate the absolute magnitude for a numeric vector where greater values are given more importance than lesser values. The arithmetic mean is typically equal or greater than the arithmetic mean.

Usage

quad.mean(x, ..., na.rm = FALSE)

Arguments

x

a numeric vector of observations

...

additional arguments passed to or from other methods

na.rm

logical by default set to FALSE. To remove NAs set argument to TRUE

Value

a numeric vector of length 1L

Details

The quadratic mean or root mean square is scale invariant but not shift invariant, shifting the input values by a fix amount will not change the point estimate.

Examples

d <- rlnorm(60,1,1.4)
quad.mean(d)
#> [1] 17.42901

x <- matrix(rlnorm(60,1,1.4), ncol = 4)
mapply(quad.mean, as.data.frame(x))
#>        V1        V2        V3        V4 
#> 23.440988  6.224937  8.573762 14.848820