1
$\begingroup$

Let me explain my question with the following example:

data("Grunfeld", package = "plm")
y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
purtest(y, pmax = 4, exo = "intercept", test = "madwu")

gives a result. But if we include a missing value in it, e.g., Grunfeld$inv[2] <- NA, then the above steps for unit root test gives the error, in lm.fit(X, y) : NA/NaN/Inf in 'x'

What can we do regarding a panel unit root test when we have missing values in our data?

$\endgroup$

1 Answer 1

1
$\begingroup$

I have solved the problem the following way. Please correct me if something is wrong.

First the panel data without missing values gives unit root results. For example,

> library(plm)
> data("Grunfeld", package = "plm")
> y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
> purtest(y, pmax = 4, exo = "intercept", test = "madwu")

        Maddala-Wu Unit-Root Test (ex. var. : Individual Intercepts )

data:  y
chisq = 47.5818, df = 20, p-value = 0.0004868
alternative hypothesis: stationarity

Now, impose a missing value to the 2nd observation, that corresponds to the year 1936.

> data("Grunfeld", package = "plm")
> Grunfeld$inv[2] <- NA
> y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
> purtest(y, pmax = 4, exo = "intercept", test = "madwu")
Error in lm.fit(X, y) : NA/NaN/Inf in 'x'

Oops! we get now error result. However the Hadri test is still working.

> data("Grunfeld", package = "plm")
> Grunfeld$inv[2] <- NA
> y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
> purtest(y, pmax = 4, exo = "intercept", test = "hadri")

        Hadri Test (ex. var. : Individual Intercepts )

data:  y
z = 23.884, p-value < 2.2e-16
alternative hypothesis: at least one series has a unit root

To get results for the "madala" test omit all observations that belong to the year 1936.

> data("Grunfeld", package = "plm")
> Grunfeld$inv[2] <- NA
> Grunfeld <- subset(Grunfeld, year !=1936)
> y <- data.frame(split(Grunfeld$inv, Grunfeld$firm))
> purtest(y, pmax = 4, exo = "intercept", test = "madwu")

        Maddala-Wu Unit-Root Test (ex. var. : Individual Intercepts )

data:  y
chisq = 39.3042, df = 20, p-value = 0.00611
alternative hypothesis: stationarity

This time we get a result.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.