plm.data: Data Frame Special Format for Panel Data (Deprecated)

Description Usage Arguments Details Value Author(s) Examples

View source: R/deprecated.R

Description

This function was once used to transform a data frame in a format suitable for using with the estimation functions of plm. New code should rather use the more versatile function pdata.frame.

Usage

1

Arguments

x

a data.frame,

indexes

a vector (of length one or two) indicating the (individual and time) indexes (see Details).

Details

This function is kept due to backward compatibility of old code. New code should use the function pdata.frame instead.

indexes can be:

Value

An object of class c("plm.dim", "data.frame").

Author(s)

Yves Croissant

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# There are 595 individuals
data("Wages", package = "plm")
Wages <- plm.data(Wages, 595)

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

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

Example output

Loading required package: Formula
    country         year        lgaspcar        lincomep          lrpmg        
 AUSTRIA: 19   1960   : 18   Min.   :3.380   Min.   :-8.073   Min.   :-2.8965  
 BELGIUM: 19   1961   : 18   1st Qu.:3.944   1st Qu.:-6.320   1st Qu.:-0.6523  
 CANADA : 19   1962   : 18   Median :4.088   Median :-5.985   Median :-0.3795  
 DENMARK: 19   1963   : 18   Mean   :4.296   Mean   :-6.139   Mean   :-0.5231  
 FRANCE : 19   1964   : 18   3rd Qu.:4.556   3rd Qu.:-5.720   3rd Qu.:-0.2234  
 GERMANY: 19   1965   : 18   Max.   :6.157   Max.   :-5.221   Max.   : 1.1253  
 (Other):228   (Other):234                                                     
    lcarpcap      
 Min.   :-13.475  
 1st Qu.: -9.307  
 Median : -8.658  
 Mean   : -9.042  
 3rd Qu.: -8.262  
 Max.   : -7.536  
                  

plm documentation built on March 18, 2018, 1:10 p.m.