At the current moment (version 1.2-10, 2012-05-05) it seems that the unbalanced case is not supported. Edit: The issue of unbalanced panel data is solved in version 2.2-2 of plm on CRAN (2020-02-21).
Rest of the answer is assuming version 1.2-10:
I've looked at the code, and the final data preparation line (no matter what is your initial argument) is the following:
object <- as.data.frame(split(object, id))
If you pass unbalanced panel, this line will make it balanced by repeating the same values. If your unbalanced panel has time series with lengths which divide each other then even no error message is produced. Here is the example from purtest page:
> data(Grunfeld)
> purtest(inv ~ 1, data = Grunfeld, index = "firm", pmax = 4, test = "madwu")
Maddala-Wu Unit-Root Test (ex. var. : Individual Intercepts )
data: inv ~ 1
chisq = 47.5818, df = 20, p-value = 0.0004868
alternative hypothesis: stationarity
This panel is balanced:
> unique(table(Grunfeld$firm))
[1] 20
Disbalance it:
> gr <- subset(Grunfeld, !(firm %in% c(3,4,5) & year <1945))
Two different time series length in the panel:
> unique(table(gr$firm))
[1] 20 10
No error message:
> purtest(inv ~ 1, data = gr, index = "firm", pmax = 4, test = "madwu")
Maddala-Wu Unit-Root Test (ex. var. : Individual Intercepts )
data: inv ~ 1
chisq = 86.2132, df = 20, p-value = 3.379e-10
alternative hypothesis: stationarity
Another disbalanced panel:
> gr <- subset(Grunfeld, !(firm %in% c(3,4,5) & year <1940))
> unique(table(gr$firm))
[1] 20 15
And the error message:
> purtest(inv ~ 1, data = gr, index = "firm", pmax = 4, test = "madwu")
Erreur dans data.frame(`1` = c(317.6, 391.8, 410.6, 257.7, 330.8, 461.2, :
arguments imply differing number of rows: 20, 15
There is no well-established technical criteria for what you are asking. But an answer to your question can be formulated. Before using your prior beliefs (which can be perfectly legitimate and useful), contemplate what the different specifications are giving you:
When you include regressors that could account for non-stationarity (like individual intercept and deterministic trend), the null hypothesis of stochastic trend is very strongly rejected. When you don't include them, the null hypothesis of a stochastic trend is strongly "not-rejected".
This, first of all, supports your visual suspicion: your panel is not stationary. Then the question becomes: "Trend-stationary" or "Unit root"? Here is where your prior knowledge becomes important: if you have out-of-sample knowledge regarding the common downward trend and the individual shocks, you should state it in your research and go with the associated specification.
And from another angle: the panel unit root test, has as null a "common unit root process". How realistic is that, given that you are dealing with different countries here? Do you have reasons to believe that the supranational economic system these countries form is integrated to such a degree that there is a common structural factor influencing them all?
Note that "common deterministic time trend" implies, in economic terms, totally different intreconnections between the countries, than "common unit root". Perhaps counter-intuitively (but proven), a common deterministic time-trend reflects a transitory relationship -like "the global economic climate has worsened and it affected everybody". This looks like a random shock, but a random shock that shifts the time trend.
A common unit root on the other hand reflects some permanent similarity at the structural level of these economies.
The dictum here is: you cannot "hand over" economic reasoning to mechanical inference procedures.
Best Answer
There are 3 main methods of regression for panel data. Pooled OLS, Fixed and Random Effects.
Mainly to select Pooled OLS you'll need to test for individual effects in the error, this mean that Var(u) differs from 0 and E(u) is also different from 0. So there is presence of individual/ Heterogeneous effects in your OLS regression and your estimators will be biased. You can confirm this Breush-Pagan LM test. So you need a futher method of regression.
If such thing happen. then you'll need to select a fixed/random effect above your OLS estimation. and you do that with Hausmann test.
Under these conditions, Modelling data panel analysis has different points about the considerations of unitroots and cointegration. But I like to take what Park (2011) and similars say about the Modelling. That there is no test of unitroots, cointegration needed to model under the fixed/random effects.
However under different estimation methods, I believe it's better to test the unitroot/stationarity of the variables, morelikely if T tends to equal N. In this case spurios regression may outcome. A formal test of unitroot rejected means your data is stational, but if this hypthesis is not rejected, cointegration should be tested. And then regression methods would be a bit more accuracy.
The idea behind the testing of unitroots and cointegration derives from the assumptions of the regression model. Random effects for example according to Woolridge has 3 core assumptions, but noone of them are related to the time series unit root. except for the one where (u_i) shall not be correlate with (u_j) for any time period inclidung i=j, the cross sectional dependence may lead to biased estimators, so the common correlated effects method of regression would be better and there unitroot and cointegration should be tested.
As you see the Panel Data Analysys without including the time regression pattern of test is well detailed. So papers don't bother about including the stationarity or the unitroots presence over the random/fixed effects methods, not even Pooled OLS.
I'd like to stay with the basics from what Park says about modelling.
Park Myumng, Hun (2011) Practical Guides To Panel Data Modeling: A Step by Step. Analysis Using Stata. University of Japan.