Download Package `plm`

Document related concepts

Choice modelling wikipedia , lookup

Least squares wikipedia , lookup

Coefficient of determination wikipedia , lookup

Data assimilation wikipedia , lookup

Transcript
make.pconsecutive
33
Details
(p)data.frame and pseries objects are made consecutive, meaning their time periods are made consecutive per individual. For consecutiveness, the time dimension is interpreted to be numeric,
and the data are extended to a regularly spaced sequence with distance 1 between the time periods for each individual (for each individual the time dimension become a sequence t, t+1, t+2,
. . . where t is an integer). Non–index variables are filled with NA for the inserted elements (rows for
(p)data.frames, vector elements for pseries).
With argument balanced = TRUE, additionally to be made consecutive, the data also can be made
a balanced panel/pseries. Note: This means consecutive AND balanced; balancedness does not
imply consecutiveness. In the result, each individual will have the same time periods in their
time dimension by taking the min and max of the time index variable over all individuals (w/o
NA values) and inserting the missing time periods. Looking at the number of rows of the resulting
(pdata.frame) (elements for pseries), this results in nrow(make.pconsecutive, balanced = FALSE)
<= nrow(make.pconsecutive, balanced = TRUE). For making the data only balanced, i.e. not demanding consecutiveness at the same time, use make.pbalanced (see Examples for a comparison)).
Note: rows of (p)data.frames (elements for pseries) with NA values in individual or time index are
not examined but silently dropped before the data are made consecutive. In this case, it is not clear
which individual or time period is meant by the missing value(s). Especially, this means: If there
are NA values in the first/last position of the original time periods for an individual, which usually
depicts the beginning and ending of the time series for that individual, the beginning/end of the
resulting time series is taken to be the min and max (w/o NA values) of the original time series for
that individual, see also Examples. Thus, one might want to check if there are any NA values in the
index variables before applying make.pconsecutive, and especially check for NA values in the first
and last position for each individual in original data and, if so, maybe set those to some meaningful
begin/end value for the time series.
Value
An object of the same class as the input x, i.e. a pdata.frame, data.frame or a pseries which is made
time–consecutive based on the index variables. The returned data are sorted as a stacked time series.
Author(s)
Kevin Tappe
See Also
is.pconsecutive to check if data are consecutive; make.pbalanced to make data only balanced
(not consecutive).
punbalancedness for two measures of unbalancedness, pdim to check the dimensions of a ’pdata.frame’
(and other objects), pvar to check for individual and time variation of a ’pdata.frame’ (and other
objects), lag for lagged (and leading) values of a ’pseries’ object.
pseries, data.frame, pdata.frame.
Examples
# take data and make it non-consecutive