Learn R Programming

plm (version 1.2-0)

pserie: panel series

Description

a class for panel series for which several usefull computations are available

Usage

between(x, ...)
Between(x, ...)
Within(x, ...)
## S3 method for class 'pserie':
lag(x, k = 1, ...)
## S3 method for class 'pserie':
diff(x, lag = 1, ...)
## S3 method for class 'pserie':
as.matrix(x, idbyrow = TRUE, ...)
## S3 method for class 'pserie':
between(x, effect = c("individual", "time"), ...)
## S3 method for class 'pserie':
Between(x, effect = c("individual", "time"), ...)
## S3 method for class 'pserie':
Within(x, effect = c("individual", "time"), ...)
## S3 method for class 'pserie':
summary(object, ...)
## S3 method for class 'summary.pserie':
print(x, ...)

Arguments

x, object
a pserie or a summary.pserie object,
effect
the (individual or time) effect,
k, lag
the number of lags for the lag and diff methods,
idbyrow
if TRUE, the lines of the matrix are the individuals,
...
further arguments.

Value

  • All these functions return an object of class pserie, except between which is a numeric vector.

Details

A pserie is obtained when a serie is extracted from a pdata.frame object. It consists on the original serie with the index attribute of the pdata.frame. Specific transformations (within and between) are available and spectial lag and diff methods are provided.

Examples

Run this code
# Create first a pdata.frame
data("EmplUK", package = "plm")
Em <- pdata.frame(EmplUK)
# Then extract a serie, which becomes a pserie
z <- Em$output
class(z)
# obtain the matrix representation
as.matrix(z)
# compute the between, within transformation
between(z)
Within(z)
# Between replicate the values for each time observations
Between(z)
# compute the first and third lag, and the difference laged twice
lag(z)
lag(z, 3)
diff(z, 2)

Run the code above in your browser using DataLab