[R] purtest and missing values (plm-package)

Katharina Mersmann kmersman at smail.uni-koeln.de
Fri Apr 25 16:46:30 CEST 2014


Because, my inbox shows a "cutted-email-version", once again:

Hello R-Community,

I have quarterly panel-data and not surprisingly missing values, in a few variables, which are differently distributed around the panel.
Now I want to run different unit-root tests.

For ADF on the pooled data set, I chose CADF-package, which can determine the number of lags automa. by SIC and handles missing values. (I hope this is the right one )

Secondly I want to run an LLC and IPS test specificially for the panel data (Levin, Lin & Chu –test and Im, Pesaran & Shin-test ) for which I use the purtest function, from plm-package.
But I don´t know how to apply it, if my series contains missing values ( so only a error-message is created)

> purtest(data.plm,data=data.plm, test = "levinlin",exo = "none",lags ="SIC")
Fehler in lm.fit(X, y) : NA/NaN/Inf in 'x'
Zusätzlich: Warnmeldung:
In Ops.factor(object[2:length(object)], object[1:(length(object) -  :
  - not meaningful for factors

So my Question is:
1.	Is there a way to handle the missing values? 
2.	Do I just omit them? And if, is there a way to integrate this by adding an ” na.omit” into the function ?


To make it easier explaining the way of proceeding, a reproducible example could be:

data("Grunfeld", package = "plm")
y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
purtest(y, pmax = 4, exo = "none", test = "levinlin",lags=”SIC”) # works no missing data

# add an NA

data("Grunfeld", package = "plm") 
x <−data.frame(split(Grunfeldinv, Grunfeld$firm))
Grunfeldinv[2]<−NA
purtest(x, pmax = 4, exo = "none", test = "levinlin",lags=”SIC”) # Error in lm.fit(X, x) : NA/NaN/Inf in 'x'

Thanks for your hints and suggestions! 
Katie


-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von Katharina Mersmann
Gesendet: Freitag, 25. April 2014 15:53
An: r-help at r-project.org
Betreff: [R] purtest and missing values (plm-package)

Hello R-Community,

 

I have quarterly panel-data and not surprisingly missing values, in a few variables, which are differently distributed around the panel.

Now I want to run different unit-root tests.

 

For ADF on the pooled data set, I chose CADF-package, which can determine the number of lags automa. by SIC and handles missing values. (I hope this is the right one )

 

Secondly I want to run an LLC and IPS test specificially for the panel data (Levin, Lin & Chu b




More information about the R-help mailing list