ci_generalized_mean: Weighting method based on generalized mean

View source: R/ci_generalized_mean.R

ci_generalized_meanR Documentation

Weighting method based on generalized mean

Description

Generalized means are a family of functions for aggregating sets of numbers (it include as special cases the Pythagorean means, arithmetic, geometric, and harmonic means). The generalized mean is also known as power mean or Holder mean.

Usage

ci_generalized_mean(x, indic_col, p, na.rm=TRUE)

Arguments

x

A data.frame containing simple indicators.

indic_col

Simple indicators column number.

p

Exponent p (real number).

na.rm

Remove NA values before processing; default is TRUE.

Value

An object of class "CI". This is a list containing the following elements:

ci_generalized_mean_est

Composite indicator estimated values.

ci_method

Method used; for this function ci_method="generalized_mean".

Note

The generalized mean with the exponent p can be espressed as:

M_p(I_1,\dots,I_n) = \left( \frac{1}{n} \sum_{i=1}^n I_i^p \right)^{\frac{1}{p}}

Particular case are: p=-\infty: minimum, p=-1: harmonic mean, p=0: geometric mean, p=1: arithmetic mean, p=2: root-mean-square and p=\infty: maximum.

Author(s)

Vidoli F.

See Also

ci_geom_gen, ci_factor

Examples

i1 <- seq(0.3, 0.5, len = 100) - rnorm (100, 0.2, 0.03)
i2 <- seq(0.3, 1, len = 100)   - rnorm (100, 0.2, 0.03)
Indic = data.frame(i1, i2)
CI = ci_generalized_mean(Indic, p=-1) # harmonic mean

data(EU_NUTS1)
CI = ci_generalized_mean(EU_NUTS1,c(2:3),p=2) # geometric mean

Compind documentation built on Nov. 20, 2023, 5:08 p.m.