% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scenarios_percent_change.R
\name{scenario_percent_baseline}
\alias{scenario_percent_baseline}
\title{Scenario to change by a fixed percentage from a baseline value by target year}
\usage{
scenario_percent_baseline(
  df,
  percent_change,
  value_col = "value",
  start_year = 2018,
  end_year = 2025,
  baseline_year = start_year,
  target_year = end_year,
  scenario_col = "scenario",
  scenario_name = glue::glue("{percent_change}_{baseline_year}"),
  trim = TRUE,
  small_is_best = FALSE,
  keep_better_values = FALSE,
  upper_limit = "guess",
  lower_limit = "guess",
  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{percent_change}{Numeric with the percentage change in \strong{points} that is
to be achieved from \code{value_col} in \code{baseline_year} by \code{target_year}. Should be
expressed a percentage point and not a fraction of 100 (e.g. 6\% increase = 6,
and not 0.06).
For an increase, use a positive numeric, and a negative one for a decrease.}

\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{baseline_year}{Year from which the scenario is measured.
Defaults to \code{start_year}}

\item{target_year}{Year by which the scenario should eventually be
achieved. Defaults to \code{end_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{scenario_name}{Name of the scenario. Defaults to scenario_{percent_change}_{baseline_year}}

\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.}
}
\value{
Dataframe with scenario rows
}
\description{
This scenario allows to change a value by a fixed percentage to a provided year
from a provided baseline year. It provides values for scenarios stated as
"Reduce INDICATOR by XX\% by YEAR"
}
\details{
The \code{percent_change} parameter is understood as a percentage change,
and not a percentage point change, as this is usually what intended by those
formulations. If it is indeed the percentage change that is required, please
use \code{scenario_aroc}. For instance, to calculate the scenario "reduce the 2018
value (90\%) by 30\% by 2025", will results to a 2025 value of 63\% and not 60\%.

The returned scenario is a portion of the straight line drawn from the
\code{baseline_year} value to the \code{target_year}. Only values for years between
\code{start_year} and \code{end_year} will be returned.
}
\seealso{
Basic scenarios
\code{\link{scenario_aroc}()},
\code{\link{scenario_bau}()},
\code{\link{scenario_best_of}()},
\code{\link{scenario_linear_change}()}
}
\concept{basic_scenarios}
\concept{percent_baseline}
