{smcl} {* *! version 1.0.0 27oct2026}{...} {vieweralsosee "xtboundpanico methods" "help xtboundpanico_methods"}{...} {vieweralsosee "xtboundpanico bounds" "help xtboundpanico_bounds"}{...} {vieweralsosee "xtboundpanico panico" "help xtboundpanico_panico"}{...} {vieweralsosee "xtboundpanico nfactors" "help xtboundpanico_nfactors"}{...} {vieweralsosee "xtunitroot" "help xtunitroot"}{...} {viewerjumpto "Syntax" "xtboundpanico##syntax"}{...} {viewerjumpto "Description" "xtboundpanico##description"}{...} {viewerjumpto "Subcommands" "xtboundpanico##subcommands"}{...} {viewerjumpto "Options" "xtboundpanico##options"}{...} {viewerjumpto "Interpreting the output" "xtboundpanico##interpret"}{...} {viewerjumpto "Remarks and practical guidance" "xtboundpanico##remarks"}{...} {viewerjumpto "Examples" "xtboundpanico##examples"}{...} {viewerjumpto "Stored results" "xtboundpanico##results"}{...} {viewerjumpto "References" "xtboundpanico##references"}{...} {viewerjumpto "Author" "xtboundpanico##author"}{...} {title:Title} {phang} {bf:xtboundpanico} {hline 2} Bounds and PANICO testing for cointegration in panels with unobserved common factors {marker syntax}{...} {title:Syntax} {p 8 17 2} {cmd:xtboundpanico} {it:subcommand} {it:depvar} {it:indepvars} {ifin} [{cmd:,} {it:options}] {synoptset 24 tabbed}{...} {synopthdr:subcommand} {synoptline} {synopt:{helpb xtboundpanico_bounds:bounds}}panel cointegration bounds test (Section 3 of the paper){p_end} {synopt:{helpb xtboundpanico_panico:panico}}PANICO with principal-component factors (Section 4){p_end} {synopt:{helpb xtboundpanico_panico:panicca}}PANICO with cross-section-average factors{p_end} {synopt:{helpb xtboundpanico_nfactors:nfactors}}number of common factors, every criterion side by side{p_end} {synopt:{cmd:all}}{cmd:bounds}, then {cmd:panico}, then {cmd:panicca}, then a synthesis{p_end} {synoptline} {pstd} The panel must be {helpb xtset} and strongly balanced with no gaps. {it:depvar} is {it:y_it}; {it:indepvars} are the {it:k} weakly exogenous stochastic regressors {it:x_it}. {marker description}{...} {title:Description} {pstd} {cmd:xtboundpanico} tests the null hypothesis of a {bf:panel spurious relationship} against the alternative of {bf:panel cointegration} when the cross-section dependence is generated by unobserved common factors whose number and order of integration are unknown. It implements Banerjee and Carrion-i-Silvestre (2026). {pstd} The data generating process is Y_it = D_it + L_i F_t + U_it, (1-L) F_t = v_t, (1-L) U_it = e_it {pstd} with Y_it = (y_it, x_it')'. The long-run slope vector {it:theta} is {bf:homogeneous} across units; the speed of adjustment, the factor loadings and the short-run dynamics are all heterogeneous. Under the null the idiosyncratic component U_it is I(1), so no stationary combination of Y_it exists. {pstd} The command offers the paper's two complementary answers to the same question. {phang2} {bf:1. Bounds testing} ({cmd:bounds}). The factors are proxied by cross-section averages and {it:theta} is estimated by the pooled CCE estimator, which is consistent even under the null. The panel statistic {it:tybar} is then compared with {bf:two} critical values: one computed as if every factor were I(0) and one as if every factor were I(1). If {it:tybar} falls outside that interval the conclusion is robust to the number and order of integration of the factors. If it falls inside, inference is {bf:inconclusive} and you move to PANICO. {phang2} {bf:2. PANICO} ({cmd:panico}, {cmd:panicca}). PANIC analysis of cointegration. The differenced, projected series are defactored, the idiosyncratic component and the factors are recumulated, and six statistics (P, Pm, Z, Pa, Pb, PMSB) test the idiosyncratic component while the ADF or the MQ statistics pin down how many factors are I(1). There is no ambiguity region, but the number of factors must be estimated. {pstd} Every step is mapped to its equation in the paper in {helpb xtboundpanico_methods:help xtboundpanico methods}. {marker subcommands}{...} {title:Subcommands} {dlgtab:bounds} {pstd} Pooled CCE coefficients with Holly-Pesaran-Yamagata standard errors, the panel bounds statistic {it:tybar}, both polar critical values at the 1, 2.5, 5 and 10% levels, a verdict (cointegration / no cointegration / inconclusive), and the CIPS comparator of Banerjee and Carrion-i-Silvestre (2017). See {helpb xtboundpanico_bounds}. {dlgtab:panico and panicca} {pstd} The six idiosyncratic statistics with p-values, plus the ADF test (one factor) or the sequential MQc/MQf tests (more than one factor) on the estimated common factors. {cmd:panico} extracts the factors by principal components; {cmd:panicca} replaces them by differenced cross-section averages, as in Reese and Westerlund (2016). See {helpb xtboundpanico_panico}. {dlgtab:nfactors} {pstd} Eleven estimators of the number of common factors side by side: ICp1-ICp3, PCp1-PCp3, AIC3 and BIC3 (Bai and Ng 2002), ER and GR (Ahn and Horenstein 2013) and ED (Onatski 2010). See {helpb xtboundpanico_nfactors}. {dlgtab:all} {pstd} Runs the three testing subcommands in order and closes with the trade-off discussed in Section 5.3 of the paper: the bounds test is simple and agnostic but has an inconclusive region; PANICO removes the ambiguity at the price of estimating {it:r}. {marker options}{...} {title:Options} {pstd} Options available to every subcommand: {phang} {opt mod:el(#)} sets the deterministic component: {cmd:0} none, {cmd:1} a constant (default), {cmd:2} a constant and a linear trend. Because attention is restricted to {it:rho_yi}, the paper's Cases 2 and 3 collapse into Model 1 and Cases 4 and 5 into Model 2. {phang} {opt fac:tors(#)} fixes the number of common factors. For {cmd:bounds} the default is {it:1+k}, the rank condition met with equality, and {it:#} may not exceed {it:1+k}. For {cmd:panico} the default is to estimate it. {phang} {opt maxl:ags(#)} maximum VAR order. The default is the paper's {it:floor(4 (T/100)^(1/4))}. {phang} {opt lags(#)} imposes a fixed order instead of selecting one. {phang} {opt lagc:rit(crit)} selection criterion: {cmd:bic} (default, as in the paper), {cmd:aic}, {cmd:maic} or {cmd:mbic} (Ng and Perron 2001; Perron and Qu 2007). {phang} {opt lev:el(#)} confidence level for the printed verdict; the default is {cmd:level(95)}. Only 90, 95, 97.5 and 99 map onto a tabulated critical value. {phang} {opt graph} draws a diagnostic figure; {opt name(name)} names it. {pstd} Subcommand-specific options are documented on each subcommand's help page. {marker interpret}{...} {title:Interpreting the output} {pstd} {bf:Pooled CCE long-run coefficients.} The estimate of the homogeneous slope vector {it:theta}, consistent at rate min(sqrt(T), sqrt(N)) whether or not the panel cointegrates. The standard error is the Holly, Pesaran and Yamagata (2010) sandwich, so you can test a theory restriction such as {it:theta = 1} directly from the reported z. {pstd} {bf:tybar.} The average over units of the t-ratio of the speed-of-adjustment coefficient in the conditional error-correction model. Large negative values are evidence of cointegration. {pstd} {bf:Lower / upper bound.} The lower bound assumes every factor is I(0); the upper bound assumes every factor is I(1). The upper bound is the more negative of the two, so {p 8 12 2}{it:tybar} < upper bound{col 44}=> cointegration, robustly{p_end} {p 8 12 2}{it:tybar} > lower bound{col 44}=> no cointegration, robustly{p_end} {p 8 12 2}in between{col 44}=> inconclusive; run {cmd:panico}{p_end} {pstd} {bf:P, Pm, Z} are group-type: they pool the per-unit ADF statistics and tolerate heterogeneous dynamics. {bf:Pa, Pb, PMSB} are pooled-type: they impose a common autoregressive parameter and are more powerful when that is true. P is chi2(2N) and is read in the upper tail; Pm in the upper tail of the standard normal; Z, Pa, Pb and PMSB in the lower tail. {pstd} {bf:ADF on Fhat} (one factor) or {bf:MQc / MQf} (several) report how many common factors carry a stochastic trend. That is exactly the information the bounds test refuses to use, and it is what resolves an inconclusive bounds result. {marker remarks}{...} {title:Remarks and practical guidance} {pstd} {bf:Sample-size regime.} The asymptotics are joint, with sqrt(T)/N -> 0 for the bounds test and N/T -> 0 for the PANICO statistics. In practice: the bounds test is usable from about T = 50, but its ambiguity region is wide there (the paper measures 0.28 probability mass at T = 50, N = 50 when the factor is I(1)) and narrows quickly in T. PANICO is more powerful than the bounds test for T >= 100 regardless of N. {pstd} {bf:Which statistic to trust.} The group-type Z, P and Pm over-reject mildly in small T because asymptotic moments and p-values are used; the paper documents this in Section 5.2. Pb and PMSB are the best behaved. Prefer them when T is small, and read agreement across the six as the real evidence. {pstd} {bf:The rank condition.} With cross-section averages as factor proxies, Assumption G caps {it:r} at {it:1+k}: only {it:1+k} averages exist. If you believe there are more factors than that, use {cmd:panico}, which estimates them by principal components and does not need the rank condition at all. {pstd} {bf:Choosing r.} Over-estimation is common when N or T is small. Run {cmd:xtboundpanico nfactors} first and compare BIC3, ER, GR and ED before settling: in the paper's own applications every Bai-Ng criterion selected {it:rmax} while Onatski's ED and Ahn-Horenstein's ratios selected 1. Over-specifying {it:r} leaves {cmd:bounds} with the I(1) critical value nearly unaffected but makes the I(0) one over-reject more. {pstd} {bf:Slope homogeneity is assumed, not tested.} Equation (10) of the paper imposes a common {it:theta}. That is the point of the method - it is what makes {it:theta} consistently estimable under the null and gives the test its power against theory restrictions such as purchasing power parity or the full Fisher effect - but it is a restriction. If you need heterogeneous slopes, the Gengenbach, Urbain and Westerlund (2016) framework is the right one, and this command is not a substitute for it. No homogeneity test is provided because the paper provides none. {pstd} {bf:What this command does not do.} The paper reports but does not tabulate critical values for the Wald and F joint-significance variants of the individual test, so they are not computed. There is no confidence interval for the speed of adjustment. Critical values for the CIPS comparator are not tabulated here; take them from Banerjee and Carrion-i-Silvestre (2017) or Pesaran, Smith and Yamagata (2013). {pstd} {bf:There is no postestimation mode}, and this is deliberate. Every statistic here is computed from the {bf:levels} of y_it and x_it - the cross-section averages, the pooled CCE projection and the principal components all need the raw panel - so there is nothing useful to recover from a fitted {helpb xtreg} or {helpb regress} in memory. Like {helpb xtunitroot}, the command takes its variables directly. It also leaves {cmd:e()} untouched, so you can run it between estimation commands without disturbing them. {pstd} {bf:Balance.} Both the cross-section averages and the principal components need a strongly balanced panel with no gaps and no missing values on any model variable. The command errors out rather than silently dropping units; use {helpb xtdescribe} and {helpb misstable} to find the problem. {pstd} {bf:Degrees of freedom.} Equation (17) of the paper writes the error variance with a full {it:T} in the denominator. Taken literally that roughly doubles the empirical size at T = 50 relative to the paper's own Table C.3, so the default here is the ordinary OLS denominator. {opt dffull} and {opt dfpaper} expose the two literal readings. The arithmetic and the Monte Carlo evidence are in {helpb xtboundpanico_methods:help xtboundpanico methods}. {marker examples}{...} {title:Examples} {pstd}Setup{p_end} {phang2}{cmd:. webuse grunfeld}{p_end} {phang2}{cmd:. xtset company year}{p_end} {pstd}How many common factors?{p_end} {phang2}{cmd:. xtboundpanico nfactors invest mvalue kstock, model(1) rmax(3)}{p_end} {pstd}The bounds test, with a trend and both polar critical values{p_end} {phang2}{cmd:. xtboundpanico bounds invest mvalue kstock, model(2)}{p_end} {pstd}Resolve an inconclusive result with PANICO{p_end} {phang2}{cmd:. xtboundpanico panico invest mvalue kstock, model(2) nfactors(bic3)}{p_end} {pstd}The cross-section-average variant, with a diagnostic figure{p_end} {phang2}{cmd:. xtboundpanico panicca invest mvalue kstock, model(2) graph}{p_end} {pstd}Everything, with the synthesis{p_end} {phang2}{cmd:. xtboundpanico all invest mvalue kstock, model(2)}{p_end} {pstd} A complete, self-checking demonstration on the paper's own Monte Carlo design - including the replication of its Table C.3 - ships with the package as {bf:xtboundpanico_example.do}. Retrieve it with {bf:. net get xtboundpanico}. {marker results}{...} {title:Stored results} {pstd} Each subcommand is {cmd:r}-class. The common entries are: {synoptset 22 tabbed}{...} {p2col 5 22 26 2: Scalars}{p_end} {synopt:{cmd:r(N)}}number of panel units used{p_end} {synopt:{cmd:r(T)}}number of periods{p_end} {synopt:{cmd:r(k)}}number of stochastic regressors{p_end} {synopt:{cmd:r(r)}}number of common factors used{p_end} {synopt:{cmd:r(model)}}deterministic specification{p_end} {synopt:{cmd:r(level)}}confidence level{p_end} {p2col 5 22 26 2: Macros}{p_end} {synopt:{cmd:r(cmd)}}{cmd:xtboundpanico}{p_end} {synopt:{cmd:r(subcmd)}}subcommand{p_end} {synopt:{cmd:r(depvar)}}, {cmd:r(indepvars)}, {cmd:r(panelvar)}, {cmd:r(timevar)}{p_end} {synopt:{cmd:r(lagcrit)}}lag selection criterion{p_end} {p2col 5 22 26 2: Matrices}{p_end} {synopt:{cmd:r(b_cce)}}pooled CCE coefficients{p_end} {synopt:{cmd:r(V_cce)}}their Holly-Pesaran-Yamagata variance{p_end} {synopt:{cmd:r(lags_i)}}selected order per unit{p_end} {pstd} Subcommand-specific results are listed on each subcommand page. {marker references}{...} {title:References} {phang} Ahn, S. C., and A. R. Horenstein. 2013. Eigenvalue ratio test for the number of factors. {it:Econometrica} 81: 1203-1227. {phang} Bai, J., and S. Ng. 2002. Determining the number of factors in approximate factor models. {it:Econometrica} 70: 191-221. {phang} Bai, J., and S. Ng. 2004. A PANIC attack on unit roots and cointegration. {it:Econometrica} 72: 1127-1177. {phang} Bai, J., and S. Ng. 2010. Panel unit root tests with cross-section dependence: a further investigation. {it:Econometric Theory} 26: 1088-1114. {phang} Banerjee, A., and J. L. Carrion-i-Silvestre. 2017. Testing for panel cointegration using common correlated effects estimators. {it:Journal of Time Series Analysis} 38: 610-636. {phang} Banerjee, A., and J. L. Carrion-i-Silvestre. 2026. Bounds and PANICO testing for cointegration in panels with common factors. University of Canterbury, Department of Economics and Finance, Working Paper 8/2026. {phang} Gengenbach, C., J.-P. Urbain, and J. Westerlund. 2016. Error correction testing in panels with common stochastic trends. {it:Journal of Applied Econometrics} 31: 982-1004. {phang} Holly, S., M. H. Pesaran, and T. Yamagata. 2010. A spatio-temporal model of house prices in the USA. {it:Journal of Econometrics} 158: 160-173. {phang} Onatski, A. 2010. Determining the number of factors from empirical distribution of eigenvalues. {it:Review of Economics and Statistics} 92: 1004-1016. {phang} Pesaran, M. H. 2006. Estimation and inference in large heterogeneous panels with a multifactor error structure. {it:Econometrica} 74: 967-1012. {phang} Pesaran, M. H. 2007. A simple panel unit root test in the presence of cross-section dependence. {it:Journal of Applied Econometrics} 22: 265-312. {phang} Pesaran, M. H., Y. Shin, and R. J. Smith. 2001. Bounds testing approaches to the analysis of level relationships. {it:Journal of Applied Econometrics} 16: 289-326. {phang} Pesaran, M. H., L. V. Smith, and T. Yamagata. 2013. Panel unit root tests in the presence of a multifactor error structure. {it:Journal of Econometrics} 175: 94-115. {phang} Reese, S., and J. Westerlund. 2016. PANICCA: PANIC on cross-section averages. {it:Journal of Applied Econometrics} 31: 961-981. {marker author}{...} {title:Author} {pstd} Dr Merwan Roudane{break} merwanroudane920@gmail.com{break} https://github.com/merwanroudane