Last data update: 2014.03.03

R: Subset of time series from the M Competitions
subset.McompR Documentation

Subset of time series from the M Competitions

Description

subset.Mcomp returns a subset of the time series data from the M Competitions. Subsets can be for specific periods, or specific types of data or both.

Usage

## S3 method for class 'Mcomp'
subset(x, cond1, cond2, ...)

Arguments

x

M-competition data or a subset of M-competition data

cond1

Type or period of the data. Type is a character variable and period could be character or numeric.

cond2

Optional second condition specifying type or period of the data, depending on cond1. If cond1 denotes type then cond2 would denote period, but if cond1 denotes period then cond2 would denote type.

...

Other arguments.

Details

Possible values for cond1 and cond2 denoting period are 1, 4, 12, "yearly", "quarterly", "monthly" and "other".

If cond1 or cond2 equals 111, then the 111 series used in the extended comparisons in the 1982 M-competition are selected.

Possible values for cond1 and cond2 denoting type are "macro", "micro", "industry", "finance", "demographic", "allother", "macro1", "macro2", "micro1", "micro2", "micro3". These correspond to the descriptions used in the competitions. See the references for details.

Partial matching used for both conditions.

Value

An object of class Mcomp consisting of the selected series.

Author(s)

Muhammad Akram and Rob Hyndman

References

Makridakis, S., A. Andersen, R. Carbone, R. Fildes, M. Hibon, R. Lewandowski, J. Newton, E. Parzen, and R. Winkler (1982) The accuracy of extrapolation (time series) methods: results of a forecasting competition. Journal of Forecasting, 1, 111–153.

Makridakis and Hibon (2000) The M3-competition: results, conclusions and implications. International Journal of Forecasting, 16, 451-476.

See Also

M1

Examples

M3.quarterly <- subset(M3,4)
M1.yearly.industry <- subset(M1,1,"industry")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Mcomp)
Loading required package: tseries
Loading required package: forecast
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: timeDate
This is forecast 7.1 

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Mcomp/subset.Mcomp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: subset.Mcomp
> ### Title: Subset of time series from the M Competitions
> ### Aliases: subset.Mcomp
> ### Keywords: data
> 
> ### ** Examples
> 
> M3.quarterly <- subset(M3,4)
> M1.yearly.industry <- subset(M1,1,"industry")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>