% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inequality.R
\name{wid_gini}
\alias{wid_gini}
\title{Compute Gini coefficient from a share series}
\usage{
wid_gini(data, variable = NULL, country = NULL)
}
\arguments{
\item{data}{A \code{wid_df} with share series.}

\item{variable}{Variable code filter.}

\item{country}{Country code filter.}
}
\value{
A \code{data.frame} with columns \code{country}, \code{year},
and \code{gini} (numeric, 0-1).
}
\description{
Requires an \code{"s"} (share) series with \code{pXpY} percentile codes
covering the full distribution.
}
\examples{
d <- data.frame(
  country = rep("US", 3L), year = rep("2020", 3L),
  variable = rep("sptinc992j", 3L),
  percentile = c("p0p50", "p50p90", "p90p100"),
  value = c(0.20, 0.40, 0.40), age = "992", pop = "j",
  stringsAsFactors = FALSE
)
class(d) <- c("wid_df", "data.frame")
wid_gini(d)
}
