calculate.arr: Get the logarithmic annual rate of reduction, expressed as a...

View source: R/funcs_do_calculation.R

calculate.arrR Documentation

Get the logarithmic annual rate of reduction, expressed as a percentage reduction

Description

The formula for ARR is as follows: ARR = ln(rate2/rate1)/(t2-t1)*-100, where t1 and t2 are years and t1<t2. Return unrounded results

Usage

calculate.arr(dt, year1, year2)

Arguments

dt

wide data by year, year1 and year2 shall be columns like 1990, 2000

year1

year1 where year1 < year2

year2

year2 where year1 < year2

Value

dt with added columns named like "1990-2000"

Examples

## Not run: 
dt_final_ARR <- dt_final[Year%in%c(1990,2019)]
dt_final_ARR_w <- dcast(dt_final_ARR, ISO3Code ~ Year)
dt_final_ARR_w <- calculate.arr(dt_final_ARR_w, 1990, 2019)

## End(Not run)


unicef-drp/CME.assistant documentation built on Oct. 15, 2023, 7:08 p.m.