growth: calculate growth of a series

Description Usage Arguments Examples

View source: R/growth.R

Description

calculate some type of growth such as rate of increase, symmetrical rate, in addition get chain relative ratio or other type ratios by specifying gap.

Usage

1
2
growth(x, diff_gap = 1, method = c("division", "difference", "auto"),
  symrate = FALSE, standard = FALSE)

Arguments

x

a numeric vector

diff_gap

the gap of calculating rate, you can get year on year rate of a annual series by specifing diff_gap for 12.

method

division: (x_t-x_{t-1})/x_{t-1}; difference: x_t-x_{t-1}; auto: select method automatically.

symrate

symmetry rate if TRUE.

standard

whether to standard the ratio. FALSE:no, TRUE:yes.

Examples

1
2
3
4
5
6
x = 1:30
growth(x, method = "division" )
growth(x, method = 2)
growth(x, method = 3, symrate = T)
x[2] = -2
growth(x, method = 3, symrate = T)

Nisus-Liu/CompositeIndex documentation built on May 7, 2019, 6:18 p.m.