I'm trying to calculate two tests on my panel data. However, following the documentations for the various packages and respective functions, I obtain errors. My search online for possible remedies has not being fruitful.
First, I want to perform a second generation panel unit root test on a panel data using the cipstest
function in the plm
package but I obtain an error: Error in approx(nintv, cvals[nintl:ninth, tintl, i], n = max(nintv) - : need at least two non-NA values to interpolate
The code I tried using to calculate the test is:
Y1CT <- cipstest(AT$y1, lags = 2, type = c("trend"), model = c("cmg"), truncated = FALSE)
Second, I want to perform a panel cointegration test on the same panel data using the pedroni99m
function in the pco
package but I obtain an error: Error in 2:dim(X)[3] : NA/NaN argument
The code I tried using to calculate the test is:
pedroni99m(PCOY1)
prior to using the above code, pedroni99m(PCOY1)
, I created a new set of dataframes, corresponding to each dependent variable and its' independent and control variables using the following codes:
PCOY1 <- data.frame(AT$y1, AT$x1, AT$x2, AT$x3, AT$x4, AT$x5, AT$x6, AT$x7, AT$z1, AT$z2, AT$z3, AT$z4)
PCOY2 <- data.frame(AT$y2, AT$x1, AT$x2, AT$x3, AT$x4, AT$x5, AT$x6, AT$x7, AT$z1, AT$z2, AT$z3, AT$z4)
PCOY3 <- data.frame(AT$y3, AT$x1, AT$x2, AT$x3, AT$x4, AT$x5, AT$x6, AT$x7, AT$z1, AT$z2, AT$z3, AT$z4)
PCOY4 <- data.frame(AT$y4, AT$x1, AT$x2, AT$x3, AT$x4, AT$x5, AT$x6, AT$x7, AT$z1, AT$z2, AT$z3, AT$z4)
Attached is a link to my data set, https://www.dropbox.com/s/wazb9kr8wictwjg/mds.csv?dl=0 ,(It is saved as a .csv
file).
The description of the data set is as follows:
- Each
y
is a dependent variable - Each
x
is an independent variable - Each
z
is a control variable
I declared the data as a panel data as follows:
AT <- pdata.frame(mds,index = c('ccode','year'))
Would be more than glad to receive your thoughtful considerations.