Learn R Programming

dse (version 2006.10-1)

percentChange: Calculate percent change

Description

Calculate the percent change relative to the data lag periods prior.

Usage

percentChange(obj, ...)
    ## S3 method for class 'default':
percentChange(obj, base=NULL, lag=1, cumulate=FALSE, e=FALSE, ...)

Arguments

obj
An object on which the calculation is to be done. The default method works for a time series vector or matrix (with columns corresponding to series, which are treated individually).
e
If e is TRUE the exponent of the series is used (after cumulating if cumulate is TRUE). e can be a logical vector with elements corresponding to columns of obj.
base
If base is provided it is treated as the first period value (that is, prior to differencing). It is prefixed to the m prior to cumulating. It should be a vector of length dim(m)[2]. (If e is TRUE then base should be log of the origina
lag
integer indicating the number of periods relative to which the percent change should be calculated.
cumulate
logical indicating if the series should be cumulated before the percent change is calculated.
...
arguments passed to other methods.

Value

  • The default method returns a time series matrix.

Details

Calculate the percent change relative to the data lag periods prior. If cumulate is TRUE then the data is cumulated first. cumulate can be a logical vector with elements corresponding to columns of obj.

See Also

ytoypc