% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gmean.R
\name{nested_gmean}
\alias{nested_gmean}
\title{Nested generalized means}
\usage{
nested_gmean(
  x,
  weights = list(NULL, NULL),
  order = c(1, -1),
  outer_weights = NULL,
  outer_order = 0,
  na.rm = FALSE
)
}
\arguments{
\item{x}{\verb{[numeric > 0]} A strictly positive numeric vector.}

\item{weights}{\verb{[list]} A list of positive numeric vector of
weights, each
the same length as \code{x}, for both of the inner generalized means. \code{NULL}
elements of \code{weights} equally weight each element of \code{x}. The default
uses equal weights for both inner generalized mean.}

\item{order}{\verb{[numeric(2)]} A finite numeric vector giving the order of each
of the inner
generalized means. The default computes an arithmetic mean and a harmonic
mean.}

\item{outer_weights}{\verb{[numeric(2)]} A strictly positive numeric vector
weights for each of
the inner generalized means as used in the outer generalized mean. The
default weights each inner generalized mean equally.}

\item{outer_order}{\verb{[numeric(1)]} A finite number giving the order of the
outer generalized mean. The default uses a geometric mean.}

\item{na.rm}{\verb{[logical(1)]} Should missing values in \code{x} and \code{weights} be
removed? By
default missing values are not removed. Note that removal of missing values
is balanced across \code{x} and both elements of \code{weights}.}
}
\value{
A numeric value for the nested generalized mean.
}
\description{
Calculate a weighted (outer) generalized mean of two (inner) generalized
means (i.e., crossing means).
}
\examples{
x <- 1:3
w1 <- c(0.25, 0.25, 0.5)
w2 <- c(0.3, 0.3, 0.4)
# Calculate the geometric mean of the arithmetic and harmonic means
# to make a Fisher index.
nested_gmean(x, list(w1, w2))
}
\seealso{
Other math functions:
\code{\link[=emean]{emean()}},
\code{\link[=gmean]{gmean()}},
\code{\link[=scale_weights]{scale_weights()}},
\code{\link[=transmute_weights]{transmute_weights()}},
\code{\link[=transmute_weights2]{transmute_weights2()}},
\code{\link[=update_weights]{update_weights()}}
}
\concept{math functions}
