Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

time-series-panel-series

Time Series and Panel Series


Description

collapse provides the following functions to work with time-dependent data:

  • flag, and the lag- and lead- operators L and F are S3 generics to efficiently compute sequences of lags and leads on ordered or unordered regular / balanced or irregular / unbalanced time series and panel data.

  • Similarly, fdiff, fgrowth, and the operators D, Dlog and G are S3 generics to efficiently compute sequences of suitably lagged / leaded and iterated differences, log-differences and growth rates. fdiff/D/Dlog can also compute quasi-differences of the form x_t - ρ x_{t-1} or log(x_t) - ρ log(x_{t-1}) for log-differences.

  • psmat is an S3 generic to efficiently convert panel-vectors or plm::pseries and data frames or plm::pdata.frame's to panel series matrices and 3D arrays, respectively.

  • psacf, pspacf and psccf are S3 generics to compute estimates of the auto-, partial auto- and cross- correlation or covariance functions for panel-vectors or plm::pseries, and multivariate versions for data frames or plm::pdata.frame's.

Table of Functions

S3 Generic Methods Description
flag/L/F default, matrix, data.frame, pseries, pdata.frame, grouped_df Compute (sequences of) lags and leads
fdiff/D/Dlog default, matrix, data.frame, pseries, pdata.frame, grouped_df Compute (sequences of lagged / leaded and iterated) (quasi-)differences or (quasi-)log-differences
fgrowth/G default, matrix, data.frame, pseries, pdata.frame, grouped_df Compute (sequences of lagged / leaded and iterated) growth rates (exact or via log-differencing, in percentage terms)
psmat default, pseries, data.frame, pdata.frame Convert panel data to matrix / array
psacf default, pseries, data.frame, pdata.frame Compute ACF on panel data
pspacf default, pseries, data.frame, pdata.frame Compute PACF on panel data
psccf default, pseries, data.frame, pdata.frame Compute CCF on panel data

See Also


collapse

Advanced and Fast Data Transformation

v1.5.3
GPL (>= 2) | file LICENSE
Authors
Sebastian Krantz [aut, cre], Matt Dowle [ctb], Arun Srinivasan [ctb], Laurent Berge [ctb], Dirk Eddelbuettel [ctb], Josh Pasek [ctb], Kevin Tappe [ctb], R Core Team and contributors worldwide [ctb], Martyn Plummer [cph], 1999-2016 The R Core Team [cph]
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.