[R] plm package index

Millo Giovanni Giovanni_Millo at Generali.com
Wed Feb 3 16:31:43 CET 2010


Dear Matt,

yes you have. 'plm' doesn't support multi-column time indices, but it should happily make do with any *single* time index whose order can be recognized by R, such as, e.g., a lexicographic ordering. 
So you will probably want to paste your indices along these lines:

> year <- rep(2000:2001,times=c(4,4))
> year
[1] 2000 2000 2000 2000 2001 2001 2001 2001
> 
> quarter <- rep(1:4,times=2)
> quarter
[1] 1 2 3 4 1 2 3 4
> 
> myind <- paste(year, quarter, sep="q")
> myind
[1] "2000q1" "2000q2" "2000q3" "2000q4" "2001q1" "2001q2" "2001q3" "2001q4"
> 
> order(myind)
[1] 1 2 3 4 5 6 7 8

(of course you must be careful with the double digits in case of months and so on).

As all 'plm' uses is "standard" R ordering, please refer to the general documentation of the R system for any issues.

Best wishes,
Giovanni

------------- original message -----------------

Message: 182
Date: Wed, 3 Feb 2010 10:37:13 +0100
From: "Bunny, lautloscrew.com" <bunny at lautloscrew.com>
To: r-help at r-project.org
Subject: [R] plm package index
Message-ID: <9B6A22F4-5DD0-4FCD-9A6F-AEE1E2108E36 at lautloscrew.com>
Content-Type: text/plain

Dear all, 

i just wonder  if there´s a way to use a two column time index field in plm package. 

the manual says the following concerning data indexing: 

a character vector of length two containing the names of the individual and the time
index,

What would y´all do with a quarterly dataset that contains one column for the period and one for the year. Do I have to convert it to one single date field first ?


thx in advance

matt
	[[alternative HTML version deleted]]

------------- end original message ---------------

Giovanni Millo
Research Dept.,
Assicurazioni Generali SpA
Via Machiavelli 4, 
34132 Trieste (Italy)
tel. +39 040 671184 
fax  +39 040 671160 



More information about the R-help mailing list