% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scenarios_linear_change.R
\name{scenario_linear_change}
\alias{scenario_linear_change}
\alias{scenario_linear_change_col}
\title{Scenario to add a linear  point change}
\usage{
scenario_linear_change(
  df,
  linear_value,
  value_col = "value",
  start_year = 2018,
  end_year = 2025,
  baseline_year = start_year,
  target_year = end_year,
  scenario_name = glue::glue("linear_change"),
  scenario_col = "scenario",
  trim = TRUE,
  small_is_best = FALSE,
  keep_better_values = FALSE,
  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"
)

scenario_linear_change_col(
  df,
  linear_value_col,
  value_col = "value",
  start_year = 2018,
  end_year = 2025,
  baseline_year = start_year,
  target_year = end_year,
  scenario_col = "scenario",
  scenario_name = glue::glue("linear_change"),
  trim = TRUE,
  small_is_best = FALSE,
  keep_better_values = FALSE,
  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{linear_value}{vector indicating the increase to apply.}

\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_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}{numeric indicating the upper bound of the data after
calculation. If \code{value_col} is already higher before calculation it will be kept}

\item{lower_limit}{numeric indicating the lower bound of the data after
calculation. If \code{value_col} is already lower before calculation it will be kept}

\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.}

\item{linear_value_col}{name of column with linear values}
}
\description{
\code{scenario_linear_change()} to add a \code{linear_value} percentage point change
to \code{baseline_value} from a \code{baseline_year}. It provides values for scenarios
stated as "Increase INDICATOR by XX\% points".

\code{scenario_linear_change_col()} wraps around \code{scenario_linear_change()} to
provide linear values from a column specified in \code{linear_value} rather than a single value.

The calculation is done by taking the \code{baseline_year} \code{value_col} and adding the
\code{linear_value} times the number of years between the baseline year and the
current year. For instance, if \code{baseline_year} is 2018, \code{linear_value} is 2,
and \code{baseline_year} \code{value_col} is 10, then 2019 \code{value_col} will be 12, 2020 14,
etc.

It differs from \code{scenario_aroc()} \code{percent_change} in two ways: it is not
compounded and it adds percentage points and not percentage of values.

\code{upper_limit} and \code{lower_limit} allow to trim values when they are exceeding
the bounds after calculations. If values were already exceeding the bounds
before calculations, they are kept.
}
\seealso{
Basic scenarios
\code{\link{scenario_aroc}()},
\code{\link{scenario_bau}()},
\code{\link{scenario_best_of}()},
\code{\link{scenario_percent_baseline}()}
}
\concept{basic_scenarios}
\concept{linear_change}
