% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inequality.R
\name{wid_percentile_ratio}
\alias{wid_percentile_ratio}
\title{Percentile threshold ratio (e.g. P90/P10)}
\usage{
wid_percentile_ratio(
  data,
  numerator = "p90",
  denominator = "p10",
  variable = NULL,
  country = NULL
)
}
\arguments{
\item{data}{A \code{wid_df} with threshold (\code{"t"}) series.}

\item{numerator}{Upper percentile code, e.g. \code{"p90"}.}

\item{denominator}{Lower percentile code, e.g. \code{"p10"}.}

\item{variable}{Variable code filter.}

\item{country}{Country code filter.}
}
\value{
A \code{data.frame} with columns \code{country}, \code{year},
and \code{ratio} (numeric: numerator threshold divided by denominator threshold).
}
\description{
Percentile threshold ratio (e.g. P90/P10)
}
\examples{
d <- data.frame(
  country = rep("US", 2L), year = rep("2020", 2L),
  variable = rep("tptinc992j", 2L),
  percentile = c("p90", "p10"), value = c(200000, 10000),
  age = "992", pop = "j", stringsAsFactors = FALSE
)
class(d) <- c("wid_df", "data.frame")
wid_percentile_ratio(d)
}
