| pseries {plm} | R Documentation | 
A class for panel series for which several useful computations are available.
between(x, ...)
Between(x, ...)
Within(x, ...)
## S3 method for class 'pseries'
lag(x, k = 1, ...)
## S3 method for class 'pseries'
diff(x, lag = 1, ...)
## S3 method for class 'pseries'
as.matrix(x, idbyrow = TRUE, ...)
## S3 method for class 'pseries'
between(x, effect = c("individual", "time"), ...)
## S3 method for class 'pseries'
Between(x, effect = c("individual", "time"), ...)
## S3 method for class 'pseries'
Within(x, effect = c("individual", "time"), ...)
## S3 method for class 'pseries'
summary(object, ...)
## S3 method for class 'summary.pseries'
print(x, ...)
x, object | 
 a   | 
effect | 
 the (individual or time) effect,  | 
k, lag | 
 the number of lags for the   | 
idbyrow | 
 if TRUE, the lines of the matrix are the individuals,  | 
... | 
 further arguments.  | 
A pseries is obtained when a series is extracted from a
pdata.frame object. It consists on the original series with the index attribute of the pdata.frame. Specific transformations (within and between) are available and special lag and diff methods are provided.
All these functions return an object of class pseries, except between which is a numeric vector.
Yves Croissant
# Create first a pdata.frame
data("EmplUK", package = "plm")
Em <- pdata.frame(EmplUK)
# Then extract a serie, which becomes a pseries
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)