plm.data {plm}R Documentation

Data Frame Special Format for Panel Data

Description

This function transforms a data frame in a format suitable for using with the estimation functions of plm.

Usage

 x <- plm.data(x, index = NULL)

Arguments

x a data.frame,
index a vector (of length one or two) indicating the (individual and time) indexes.

Details

indexes can be :

Value

A data.frame.

Author(s)

Yves Croissant

Examples


# There are 595 individuals

data("Wages", package="Ecdat")
Wages <- plm.data(Wages, 595)

# Gasoline contains two variables which are individual and time indexes
# The pdata.frame is called gas
data("Gasoline", package="Ecdat")
Gasoline <- plm.data(Gasoline, c("country","year"))
summary(Gasoline)

# Hedonic is an unbalanced panel, townid is the individual index
data("Hedonic", package="Ecdat")
Hedonic <- plm.data(Hedonic, "townid")


[Package plm version 1.1-1 Index]