pseries {plm} | R Documentation

## panel series

### Description

A class for panel series for which several useful computations are available.

### Usage

    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, ...)

### Arguments

`x, object` | a `pseries` or a `summary.pseries` 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.

### Details

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.

### Value

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

### Author(s)

Yves Croissant

### Examples

    # 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)

[Package plm version 1.5-12 Index]