tsNumToIndex: Converts a numeric series to an index using the first...

Description Usage Arguments Details Value See Also Examples

Description

Converts a numeric series to an index using the first observation as reference.

Usage

1
tsNumToIndex(x, base = 100, reference = 1)

Arguments

x

Time-indexed data to convert, must be a ts or zoo object.

base

(Optional) Default is 100.

reference

(Optional) Observation to be used as proportions are calculated.

Details

If using a monetary series be sure to deflate it before indexing.

Value

Time series (ts or zoo) with the index.

See Also

tsVarToIndex

Examples

1
2
3
4
# Production averages 1254 units per month  
production <- ts( rnorm(30*12,mean=1254,sd=425),start=c(1980,1),freq=12)
ip  <- tsNumToIndex( production ) # industrial production index 
ip2 <- tsNumToIndex( production, reference = c(1992,6) ) # rebase for June 1992

fcbarbi/macroR documentation built on May 16, 2019, 12:05 p.m.