
Time Series and Panel Series
time-series-panel-series.Rdcollapse provides a flexible and powerful set of functions and classes to work with time-dependent data:
findex_by/ibycreates an 'indexed_frame': a flexible structure that can be imposed upon any data-frame like object and facilitates indexed (time-aware) computations on time series and panel data. Indexed frames are composed of 'indexed_series', which can also be created from vector and matrix-based objects using thereindexfunction. Further functionsfindex/ix,unindex,is_irregularandto_plmhelp operate these classes, check for irregularity, and ensure plm compatibility. Methods are defined for various time series, data transformation and data manipulation functions in collapse.timeidefficiently converts numeric time sequences, such as 'Date' or 'POSIXct' vectors, to a time-factor / integer id, where a unit-step represents the greatest common divisor of the underlying sequence.flag, and the lag- and lead- operatorsLandFare S3 generics to efficiently compute sequences of lags and leads on regular or irregular / unbalanced time series and panel data.Similarly,
fdiff,fgrowth, and the operatorsD,DlogandGare S3 generics to efficiently compute sequences of suitably lagged / leaded and iterated differences, log-differences and growth rates.fdiff/D/Dlogcan also compute quasi-differences of the form \(x_t - \rho x_{t-1}\).fcumsumis an S3 generic to efficiently compute cumulative sums on time series and panel data. In contrast tocumsum, it can handle missing values and supports both grouped and indexed / ordered computations.psmatis an S3 generic to efficiently convert panel-vectors / 'indexed_series' and data frames / 'indexed_frame's to panel series matrices and 3D arrays, respectively (where time, individuals and variables receive different dimensions, allowing for fast indexation, visualization, and computations).psacf,pspacfandpsccfare S3 generics to compute estimates of the auto-, partial auto- and cross- correlation or covariance functions for panel-vectors / 'indexed_series', and multivariate versions for data frames / 'indexed_frame's.
Table of Functions
| S3 Generic | Methods | Description | ||
findex_by/iby, findex/ix, reindex, unindex, is_irregular, to_plm | For vectors, matrices and data frames / lists. | Fast and flexible time series and panel data classes 'indexed_series' and 'indexed_frame'. | ||
timeid | For time sequences represented by integer or double vectors / objects. | Generate integer time-id/factor | ||
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 log-differences | ||
fgrowth/G | default, matrix, data.frame, pseries, pdata.frame, grouped_df | Compute (sequences of lagged / leaded and iterated) growth rates (exact, via log-differencing, or compounded) | ||
fcumsum | default, matrix, data.frame, pseries, pdata.frame, grouped_df | Compute cumulative sums | ||
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 |