% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scenarios_target_specific_values.R
\name{scenario_quantile}
\alias{scenario_quantile}
\title{Scenario to add a linear percentage point aimed at quantiles}
\usage{
scenario_quantile(
  df,
  n = 5,
  value_col = "value",
  start_year = 2018,
  end_year = 2025,
  quantile_year = start_year,
  baseline_quantile_year = start_year - 5,
  baseline_year = start_year,
  scenario_name = glue::glue("quantile_{n}"),
  scenario_col = "scenario",
  trim = TRUE,
  small_is_best = FALSE,
  keep_better_values = TRUE,
  upper_limit = 100,
  lower_limit = 0,
  trim_years = TRUE,
  start_year_trim = start_year,
  end_year_trim = end_year,
  ind_ids = billion_ind_codes("all"),
  default_scenario = "default"
)
}
\arguments{
\item{df}{Data frame in long format, where 1 row corresponds to a specific
country, year, and indicator.}

\item{n}{number of quantile to create (5 for quintile, 4 for quartiles, etc.)}

\item{value_col}{Column name of column with indicator values.}

\item{start_year}{Start year for scenario, defaults to 2018.}

\item{end_year}{End year for scenario, defaults to 2025}

\item{quantile_year}{year at which the the quantiles ARC should be calculated.}

\item{baseline_quantile_year}{baseline year at which the quantiles ARC should
be calculated.}

\item{baseline_year}{Year from which the scenario is measured.
Defaults to \code{start_year}}

\item{scenario_name}{Name of the scenario. Defaults to scenario_{percent_change}_{baseline_year}}

\item{scenario_col}{Column name of column with scenario identifiers. Useful for
calculating contributions on data in long format rather than wide format.}

\item{trim}{logical to indicate if the data should be trimmed between
\code{upper_limit} and \code{lower_limit}.}

\item{small_is_best}{Logical to identify if a lower value is better than a higher
one (e.g. lower obesity in a positive public health outcome, so obesity rate
should have small_is_best = TRUE).}

\item{keep_better_values}{logical to indicate if "better" values should be
kept from \code{value_col} if they are present. Follows the direction set in
\code{small_is_best}.  For instance, if small_is_best is TRUE, then \code{value_col} lower
than \code{col} will be kept.}

\item{upper_limit}{limit at which the indicator should be caped.
Can take any of "guess", or any numeric. \code{guess} (default) will take 100 as
the limit if \code{percent_change} is positive, and 0 if negative.}

\item{lower_limit}{limit at which the indicator should be caped.
Can take any of "guess", or 0 to 100. \code{guess} (default) will take 0 as the
limit if \code{percent_change} is positive, and 100 if negative.}

\item{trim_years}{logical to indicate if years before \code{start_year_trim} and after
\code{end_year_trim} should be removed}

\item{start_year_trim}{(integer) year to start trimming from.}

\item{end_year_trim}{(integer) year to end trimming.}

\item{ind_ids}{Named vector of indicator codes for input indicators to the Billion.
Although separate indicator codes can be used than the standard, they must
be supplied as a named vector where the names correspond to the output of
\code{billion_ind_codes()}.}

\item{default_scenario}{name of the default scenario to be used.}
}
\description{
\code{scenario_quantile} aims to reach the mean quantile average annual change
(ARC) in which a country is at \code{quantile_year}. The target is based on the
ARC between \code{quantile_year} and \code{baseline_quantile_year}. If ARC is under the mean
of the quantile, it will aim at the mean, and at the higher limit of the
quantile if above the mean.
}
\details{
Calculates the quantile target, then wraps around
\code{scenario_linear_change_col} to aim at the target.
}
\seealso{
Comparing scenarios
\code{\link{scenario_bau}()},
\code{\link{scenario_best_in_region}()},
\code{\link{scenario_best_of}()}
}
\concept{comparing_scenario}
