EconStatsCraft rigorous, plain-spoken econometrics
Econometrics that explains itself.
Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.
Load a dataset to see it here.
EconStatsCraft › Panel cointegration tests
Before you estimate a long-run relationship in a panel, test that there is one. Six statistics from the two families the field uses - Westerlund's error-correction tests and Pedroni's residual tests - with p-values bootstrapped from your own panel, so a common global shock does not invalidate them the way a printed table would.
Two drunks walking home are each unpredictable, but if they are walking home TOGETHER the distance between them stays bounded - and that bounded distance is the whole of cointegration. Granger showed that regressing one wanderer on another that it is not tied to produces high R-squared and enormous t-statistics out of nothing at all, which is why the test has to come before the regression. In a panel you have many pairs of drunks, and testing each one separately wastes information: a relationship too weak to detect in any single country over thirty years can be visible across twenty countries at once. The difficulty is that the countries are not independent - a global recession moves all of them - so the classic tabulated critical values, which assume they are, do not apply.
Before any long-run panel estimate. If the variables are I(1) and NOT cointegrated, a regression in levels is spurious and the t-statistics are meaningless however good they look. If they are cointegrated, differencing throws the long-run information away. This test is what decides which.
Westerlund's tests come from the conditional error-correction model \Delta y_{it}=\delta_i'd_t+\alpha_i y_{i,t-1}+\gamma_i'x_{i,t-1}+\sum_{j=1}^{p}\lambda_{ij}\Delta y_{i,t-j}+\sum_{j=0}^{p}\psi_{ij}'\Delta x_{i,t-j}+e_{it}, in which the long run is \beta_i=-\gamma_i/\alpha_i and cointegration is exactly \alpha_i<0. The group-mean statistics average the entity evidence, G_t=N^{-1}\sum_i\hat\alpha_i/\mathrm{se}(\hat\alpha_i) and G_a=N^{-1}\sum_i T\hat\alpha_i/(1-\sum_j\hat\lambda_{ij}), and reject when SOME entity cointegrates. The panel statistics impose \alpha_i=\alpha: partial the entity-specific nuisance terms out of both \Delta y_{it} and y_{i,t-1}, stack, and regress, giving P_t=\hat\alpha/\mathrm{se}(\hat\alpha) and P_a=T\hat\alpha. Pedroni's route is residual-based instead: run y_{it}=a_i+b_i'x_{it}+\hat e_{it} in levels and test \hat e_{it} for a unit root, averaging the ADF t-statistics (group) or pooling to one common root (panel).
\Delta y_{it}=\delta_i'd_t+\alpha_i\left(y_{i,t-1}-\beta_i'x_{i,t-1}\right)+\sum_j\lambda_{ij}\Delta y_{i,t-j}+\sum_j\psi_{ij}'\Delta x_{i,t-j}+e_{it}\qquad H_0:\alpha_i=0\ \forall i
On twenty-four countries of import demand over forty-five years - built to be I(1) in levels and cointegrated in all twenty-four - every statistic rejects at the 0.5% level: Gt = -3.62, Pt = -18.69, Pedroni group ADF = -3.78. The entity bar chart is the instructive part: far fewer than twenty-four countries clear the dashed significance line on their own forty-five observations, even though all twenty-four genuinely cointegrate. That gap between what one country can prove and what twenty-four can prove together is the whole argument for panel tests.
| If you see this | It means | Do this |
|---|---|---|
| All six reject | Cointegration | Estimate the long run - Mean Group or PMG - rather than differencing |
| Group tests reject, panel tests do not | The tie exists for some entities only | Mean Group. A common adjustment speed is what the panel tests could not find |
| Panel tests reject, group tests do not | A weak but common relationship | Pooling bought the power. PMG is defensible, but check the entity bar chart |
| Nothing rejects and T is small | Low power, not necessarily no relationship | Report the non-rejection as inconclusive and say so |
| Pedroni rejects and Westerlund does not | The common-factor restriction happens to hold | Unusual. Look at whether the levels regression is driven by one entity |
| Results swing with the lag order | Serial correlation is not being absorbed | Try one more lag; if it still swings, the panel is too short for this test |
Panel unit-root tests, which come first - cointegration is a statement about I(1) variables. Heterogeneous panel estimators, which come next, once the test says there is a long run to estimate.
Panel regression · Heterogeneous panel: Mean Group & PMG · Gravity model of trade · Dynamic panel GMM · Panel diagnostics · Panel unit-root tests
Line chart · Area chart · Bar chart · Stacked bar · Scatter plot · Bubble chart · Histogram · Box plot · Pie chart · Heat map · Rebased to 100 · Lorenz curve and Gini
World map · Bivariate map · Flow map · India - state map · India - district map
Descriptive statistics · Summary by group · Two-way table · Classical statistical tests
Multiple regression (OLS) · Logit / Probit · Tobit (censored) · Truncated regression · Multinomial logit · Ordered logit / probit · Quantile regression · Poisson / Negative binomial
Time-varying coefficients (Kalman) · Unit root tests · Correlogram (ACF / PACF) · ARIMA / SARIMA · Rolling-origin cross-validation · Theta method · Unobserved components · STL forecasting · Forecast combination · Markov regime switching · Change frequency (resample) · ARCH / GARCH volatility · Decompose & filter · Spectral analysis · Exponential smoothing · Forecast accuracy
Yield curve (Nelson–Siegel / Svensson) · Dynamic factor model · Dynamic regression (ARIMAX) · Structural VAR · VAR · Granger causality · Cointegration · VECM · ARDL & bounds test
Panel regression · Panel cointegration tests · Heterogeneous panel: Mean Group & PMG · Gravity model of trade · Dynamic panel GMM · Panel diagnostics · Panel unit-root tests
Principal components (PCA) · Factor analysis · Cluster analysis
Conjoint analysis · MaxDiff (best–worst scaling) · TURF - reach of a product line · Price sensitivity (Van Westendorp) · Market basket analysis · Perceptual map · Scale reliability (Cronbach’s alpha) · Key driver analysis
Spatial autocorrelation · Spatial regression · Heckman selection · Instrumental variables (2SLS) · Difference-in-differences · Staggered difference-in-differences · Regression discontinuity · Matching & weighting · Oaxaca–Blinder decomposition
Black–Scholes option pricing · Bond price, duration & convexity · Merton distance to default · EMI / home loan planner · CAPM / beta estimation · Multi-factor model · Portfolio optimization · Value at Risk & Expected Shortfall · Performance & drawdown · Time value of money & NPV/IRR · Equity valuation (DDM, FCF, residual income) · Cost of capital (WACC) · Binomial option pricing · Option strategies (payoff & profit) · Forwards, futures & swaps · Credit risk & Basel capital · Extreme value theory (tail risk)
Life table · Life annuity · Life insurance pricing · Chain ladder reserving · Buhlmann credibility · Survival analysis · Mortality graduation · Aggregate loss model · Ruin probability · Multi-state Markov model · Loss severity fitting
Monte Carlo experiment · F-test, Wald & Chow · Structural breaks & stability
Regression vs machine learning · Ridge / Lasso / Elastic Net · Random forest · Gradient boosting
EconStatsCraft rigorous, plain-spoken econometrics
Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.
Load a dataset to see it here.
Pick the example closest to your question. You get a spreadsheet with the right columns and a few rows showing the expected format - replace the numbers with your own, then paste or upload it back.
Copy the header row from the table above (or from the downloaded template), put your own rows underneath, and paste the whole thing here. It is checked against the layout before anything is imported.
Or click a row in the preview below.
For a units or notes row.
Search every source at once. World Bank indicators need countries and years; everything else loads in one click.
Loading the catalogue…
The engine stays loaded, so this is quick - and it leaves your open tab and panel layout alone.
⌘/Ctrl+Enter runs the current analysis. ⌘/Ctrl+P exports the session as a PDF. Esc closes this.
In the Notebook: Enter starts a new block and
Shift+Enter a new line inside one; Backspace at the start
joins back into the paragraph above; / on an empty line inserts anything.
⌘/Ctrl+B, I, E, H and
M apply bold, italic, code, highlight and maths.
#, ##, -, 1., > and
``` at the start of a line convert it.
Sign in to run unlimited analyses.
Scroll to pan · Esc to close