Data sources and model building
The hypothesis tested in this present study is the tripartite relationship between trade openness, foreign direct investment inflow and economic crisis on economic growth in Nigeria. To give credence to the established hypothesis, we trend on the standard Cobb–Douglas production function. The Cobb–Douglas production function is adopted in this study as our frontier model with a distinct augmentation involving FDI inflows % of GDP, export and import % of GDP, FDI outflows % of GDP, economic crisis, real capital stock, domestic credit to private sector and trade openness % of GDP. Cobb–Douglas production function has been employed by various authors in investigating FDIgrowth nexus as seen in Bandara [9], Ilgun et al. [36] and Makiela and Ouattarra [52]. The Cobb–Douglas production function was written in functional form by Philip Wicksteed but tested and developed against the statistical evidence provided by Charles Cobb and Paul Douglas. The Cobb–Douglas production function is expressed thus;
$${Q}_{t}={A}_{t}{L}_{t}^{\beta }{K}_{t}^{1\beta }0<\beta <1$$
(1)
In the above Eq. 1, Q is real economic output, K is capital stock, L is labor force, and A is technological progress. In line with previous statement, the production function is extended by assuming that technological progress is a function of trade openness, foreign direct investment inflow and the neteffect from the economic crisis. Thus, A is specified as follows:
$${A}_{t}=\varnothing .{trade}_{t}^{\alpha }{inflow}_{t}^{\alpha }{pcrd}_{t}^{\tau }$$
(2)
Trade in the above equation stands for trade openness, inflow and crisis represent FDI inflow and economic crisis of 2007–2018, and commodity price shock of 2016, pcrd is other factor that may determine the level of technology, \(\varnothing\) is the time invariant constant. Following extant studies, Eq. (2) is substituted in Eq. (1), as thus:
$${Q}_{t}={\varnothing .{trade}_{t}^{\alpha }{inflow}_{t}^{\alpha }{pcrd}_{t}^{\tau }L}_{t}^{\beta }{K}_{t}^{1\beta }$$
(3)
Applying log to the above Eq. 3 the extended basedline model is given as thus;
$${lnQ}_{t}={\theta }_{0}+{\theta }_{1}{lntrade}_{t}+{\theta }_{2}{inflow}_{t}+{\theta }_{3}{lnk}_{t}+{\theta }_{4}{lnl}_{t}+{\theta }_{5}{lnpcrd}_{t}+{\varepsilon }_{t}$$
(4)
Equation 4 addresses the first objective of this study which investigate the impact of trade openness and FDI inflow in Nigeria. The variables in the above equation are identified as thus: \({\theta }_{0}\) is a constant term, \({lnQ}_{t}\) is for real GDP, Real GDP is simply the macroeconomic measure for the yearly economic output of a country adjusted for price changes. Indeed, Real GDP is a sufficient measure of economic growth in our study, although, per capita GDP has been used tremendously in empirical literature, but our study pitch its tent in Real GDP to capture economic growth.
The decomposition of trade openness into total trade (import and export), import trade and export trade is necessary to capture the individual effects on economic growth amidst the economic crisis. The adoption was further cemented in the case of Nigeria, posing as an importdependent country with a high demand for a large variety of consumer goods and techrelated consumer goods and exportoriented in agriculture, gold and fossil fuels. Zahonogo [77] investigated the tradegrowth nexus in SubSaharan Africa and adopted the logarithm of import and export in their robustness check as a followup to the main model estimated. lnimport and lnexport respectively should exert a positive impact on economic growth. lnimport and lnexport respectively should exert positive impact of economic growth. \({lntrade}_{t}\) is for total trade, Apart from FDI, OECD, in its 2011 Special Report titled “Science, Technology and Industry Scoreboard”, posited that there is evidence of the impact of the economic crisis on international trade from 2008 to 2009 evident in the decrease of this ratio in OECD countries and BRICS countries within the same period. Another valid justification can arise from measuring the level of economic integration. The study of Gaies et al. [33] and Dornean et al. [23] utilized trade openness in their study on the FDIgrowth nexus.
\({inflow} is\) FDI inflow as a percentage of the GDP. This variable is worthy after its establishment as a recipient of global shocks from crisis or economic downturns, as established in the work of Egboro [27] and Bandara [9]. During the crisis, inflows and outflows occur simultaneously in some countries, while in others, it may occur in a oneway direction as pronounced in available academic literature. Nigeria is a practical example where FDI is highly sensitive to economic policy shifts necessitating outflows and inflows depending on the scenario.
lnl for labor force. This variable is an unchangeable component of the Cobb–Douglas production function and also contributes to output as posited in the study of Ilgun et al. [36] on FDIgrowth nexus in the case of Turkey.
lnk is for real capital stock, Real capital stock generated from gross fixed capital formation: Capital accumulation has been tainted by many economists as a channel for engendering growth and vast number of scholars prefer to use gross fixed capital formation to that effect. Our study generates real capital stock from GFCF via perpetual inventory model computation to increase model uniqueness in comparison with past studies. Following extant study such [39, 62], the formula is given as thus:
$${K}_{t}={K}_{t1}\left(1\delta \right)+{I}_{t}$$
(5)
Building on previous studies, \({K}_{t}\) is defined as the current capital stock, whereas \({K}_{t1}\) indicates as the capital stock of the year prior to the current, with an annual rate of depreciation δ = 5% used in this study. The initial level of capital stock is computed as:
$${K}_{0}={I}_{0}/\left(g+\delta \right)$$
(6)
In which \({K}_{0}\) is the initial capital stock,\({I}_{0}\) is the initial capital investment, δ is previously defined, and g indicates the average growth rate of capital investment used to generate the initial capital stock over the period of the study.
\({lnpcrd}_{t}\) is for financial development indicator, Domestic credit to the private sector: Availability of finance engenders growth through multichannels and in a bid not to fall prey to omitted variable bias, we included credit to the private sector, which has proved over the years to be a growth stimulator through manufacturing growth, reduction in the unemployment rate and a rise in the standard of living of citizens, hence its inclusion. The study of Aizenman et al. [4] employed domestic credit to the private sector in their analysis on Capital Flows and Economic Growth in the era of crisis. \({\varepsilon }_{t}\) is the white noise error term. This study spans 1982 to 2018 and the data are sourced from the World Development Indicators, World Bank.
The second objective is to evaluate the effect of trade openness and FDI during economic crises in Nigeria by incorporating the interaction term between the economic crisis of 2007–2008 and the commodity price shock of 2016 as additional independent variables in the model. This allows us to test whether the total effect of FDI and trade openness on economic growth is a combined positive or negative during the crisis periods.
$${lnQ}_{t}={\theta }_{0}+{\theta }_{1}{lntrade}_{t}+{\theta }_{2}{inflow}_{t}+{{\theta }_{3}lnk}_{t}+{{\theta }_{4}lnl}_{t}+{\theta }_{5}{lnpcrd}_{t}+{{\theta }_{6}crisis}_{t}+{\theta }_{7}{lntrade}_{t}*{crisis}_{t}+{\theta }_{8}{inflow}_{t}*{crisis}_{t}+{\varepsilon }_{t}$$
(7)
Crisis is the dummy variables indicator. We employ a single dummy variable to proxy crises that affected Nigeria throughout the timespan covered, namely; 2007–2008 global financial crisis and commodity oil price shock in 2016. We encompassed both events into one dummy variable; the crisis is the new dummy variable poised to capture both crises, so it takes the value of 1 for 2007–2009, 2016 and 0 for otherwise (see [23]). This method is distinct from the measures used in Jimborean and Kelber [38] and Brunnermeier [16], where quarterly data was employed.
In line with apriori expectations, \({\theta }_{1},\) \({\theta }_{2}{,\theta }_{3},\) \({\theta }_{4}\) and \({\theta }_{5}\) are expected to exert a positive impact on economic growth, an indication that trade openness and FDI inflow are the driving forces of economic growth in Nigeria. The signs of the interaction term coefficients evaluate if the interaction of economic crisis (financial crisis of 2007/2008 and the commodity price shock of 2016) on trade openness and FDI inflow enhances or distorts the impact of trade openness and FDI inflow on economic growth. A negative sign indicates that the economic crisis reduces the effect of trade openness and FDI inflow on economic growth and vice versa. Since the target variables are trade openness and FDI inflow, the total effect of trade openness on economic growth given the economic crisis is calculated as thus:^{Footnote 1}
Trending on similar studies [2, 3] the interpretation of the interaction terms is based on the following five possibilities:

1.
If \({\theta }_{7}\), \({\theta }_{8}\) = 0 it shows that the interaction of economic crisis (financial crisis of 2007/2008 and the commodity price shock of 2016) with trade openness and FDI inflow have no significant impact on growth.

2.
If \({\theta }_{7}\), \({\theta }_{8}\) > 0 it implies that of economic crisis (financial crisis of 2007/2008 and the commodity price shock of 2016) is a booster of trade and FDI inflow on growth.

3.
If\({\theta }_{7}\), \({\theta }_{8}\) < 0, the overall impact of trade openness and FDI inflow on growth depends on the magnitude of the negative coefficient.

4.
If the negative sign of \({\theta }_{7}\), \({\theta }_{8}\) outweighs the positive sign of \({\theta }_{1}\), \({\theta }_{2}\) then economic crisis (financial crisis of 2007/2008 and the commodity price shock of 2016) distorts the impact of trade openness and FDI inflow on economic growth.

5.
If the negative sign of \({\theta }_{7}\), \({\theta }_{8}\) is less than the positive sign of \({\theta }_{1}\), \({\theta }_{2}\) it implies that the distortionary influence of economic crisis (financial crisis of 2007/2008 and the commodity price shock of 2016) is not sufficient to inhibit the positive effect of trade openness and FDI inflow on growth.
Estimation technique
Combined cointegration (Bayer and Hanck [10])
Different techniques have been adopted recently to ascertain the longrun stable state among variables considering the controversy surrounding the inconclusiveness in the general acceptability of cointegration results [66]. To facilitate an improved power of the cointegration test, with the unique aspect of generating a joint teststatistic for the null of nocointegration based on gloried traditional methods such Engle and Granger, Johansen, Peter Boswijk, and Banerjee tests, the new technique proposed by Bayer and Hanck [10] is adopted. The scholarly advantage of this technique over others is that it provides a platform to combine various individual cointegration test results; it also incorporates the computed significance level (pvalue) of individual cointegration tests. In this study, Fisher’s equation is as follows:
$$EGJOHBOBDM=2[\mathrm{ln}\left({P}_{EG}\right)+\left({P}_{JOH}\right)+\left({P}_{BO}\right)+\left({P}_{BDM}\right)]$$
(8)
While the statistical rule follows as thus; the null hypothesis of nocointegration is rejected on the premise of estimated Fisher statistics exceeding the critical values provided by Bayer and Hank [10]. The symbols \({P}_{EG}\), \({P}_{JOH}\),\({P}_{BO}, {and P}_{BDM};\) are the pvalues of the respective individual cointegration tests.
Augmented ARDL analysis
This study employs Augmented ARDL proposed by McNown et al. [54]; Sam et al. [70]; Pesaran et al. [60] and to investigate the longrun relationship between the variables in Eqs. 4 and 7. There are several advantages attributed to the Augmented ARDL analysis. Some of the salient features of AARDL are (i.) Inclusion of dummy variables to account for possible policy change or economic shock [54, 60]. (ii) a dynamic error correction model (ECM) can be derived from ARDL through a simple linear transformation (iii) different variables can be assigned multilag lengths as they enter the model (See [59]). The advantages over other techniques are as follows: (i.) the order of integration of variables is either 1(0), I(1) or a mix of both I(0) and I(1), the order of integration must not be greater than I(1). (ii.) the assumption of an I(1) dependent variable is unnecessary. (iii.) The three tests provide a clear conclusion on the cointegration status overall Ftest on lagged level variables, ttest on the lagged level of the dependent variable, and Ftest on the lagged levels of the independent variable(s)). (iv.) The test is robust in the presence of a limited sample size and endogeneity [54].
The loglinear specification of Eq. 4 without the interaction is modelled using Augmented ARDL approach as given thus:
$${\Delta lnQ}_{t}={\theta }_{0}+{\theta }_{1}{Q}_{t1}+{\theta }_{2}{lntrade}_{t1}+{\theta }_{3}{lnk}_{t1}+{\theta }_{4}{lnl}_{t1}+{\theta }_{5}{lnpcrd}_{t1}+{\theta }_{6}{crisis}_{t}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lntrade}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+{\varepsilon }_{t}$$
(9)
$${\Delta lnQ}_{t}=\;{\theta }_{0}+{\theta }_{1}{Q}_{t1}+{\theta }_{2}{inflow}_{t1}+{\theta }_{3}{ink}_{t1}+{\theta }_{4}{lnl}_{t1}+{\theta }_{5}{lnpcrd}_{t1}+{\theta }_{6}{lncrisis}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{t1}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lninflow}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+{\varepsilon }_{t}$$
(10)
crisis without natural log in Eqs. 9 & 10 is the dummy variable poised to capture both crises, so it takes the value of 1 for 2007–2009, 2016 and 0 for otherwise.
The loglinear specification of Eq. 7 with the interaction is modelled using AARDL approach as given thus
$${\Delta lnQ}_{t}=\;{\theta }_{0}+{\theta }_{1}{Q}_{t1}+{\theta }_{2}{lntrade}_{t1}+{\theta }_{3}{lnk}_{t1}+{\theta }_{4}{lnl}_{t1}+{\theta }_{5}{lnpcrd}_{t1}+{\theta }_{6}(lntrade*{lncrisis)}_{t}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lntrade}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{g}{\delta }_{6i}{\Delta (trade*lncrisis)}_{6ti}+{\varepsilon }_{t}$$
(11)
$${\Delta lnQ}_{t}=\;{\theta }_{0}+{\theta }_{1}{Q}_{t1}+{\theta }_{2}{inflow}_{t1}+{\theta }_{3}{ink}_{t1}+{\theta }_{4}{lnl}_{t1}+{\theta }_{5}{lnpcrd}_{t1}+{\theta }_{6}(inflow*{lncrisis)}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lninflow}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{v}{\delta }_{6i}{\Delta (inflow*lncrisis)}_{5ti}+{\varepsilon }_{t}$$
(12)
The null hypothesis under this model is stated as thus

(i)
Ftest which tests the significance of the coefficients of all the lagged variables: \({H}_{O}:{\theta }_{1}= {\theta }_{2}=...= {\theta }_{6}\mathrm{ are }=0\) against \({H}_{O}:{\theta }_{1}\ne {\theta }_{2}\ne ..\ne {\theta }_{6} are \ne 0\)

(ii)
ttest which tests the significance of the coefficients of the lagged level of the dependent variable: \({H}_{O}:{\theta }_{1}=0\) against \({H}_{O}:{\theta }_{1}\ne 0\)

(iii)
F*test which tests the significance of the coefficients of all the lagged level of the independent variable: \({H}_{O}: {\theta }_{2}=...= {\theta }_{6}\mathrm{ are }=0\) against \({H}_{O}:{\theta }_{2}\ne ..\ne {\theta }_{6} are \ne 0\)
The decision rule follows: The null hypotheses above must be rejected; otherwise, degenerate lagged of the independent variable case or degenerate lagged of the dependent variable case. Pesaran et al. [65] and Sam et al. [70] proposed two sets of asymptotic critical values: in the case of purely I(1) and purely I(0) regressors. The testing protocol is as follows: i.) implement the [65] Ftest for the joint significance of the coefficients on the level (ii.) a ttest for the lagged dependent variables, a nonstandard distribution under the null hypothesis in the sense that no level relationship exists regardless of whether the regressors are I(0) or I(1). (iii.) following Pesaran et al. [65], McNown et al. [54], we introduce additional ttest or Ftest on the lagged independent variables to mitigate the problem of degenerate case 1. (iv.) this study applied the upper and lower critical bounds to evaluate the null hypothesis of no cointegration among variables. Further, the following estimation protocols are implemented, (i) Compare the computed Fstatistic from Eqs. (11 and 12) to the Pesaran et al. [65], Narayan (2005) and Sam et al. [70] critical bounds depending on the sample size, hence, the null hypothesis is rejected when the calculated Fstatistics or tstatistics in absolute is greater than the upper critical bound, (ii) put in another form, we accepted null hypothesis when it is less than the lower bound, (iii) Fstatistics and tstatistics is inconclusive when the Fstatistics or tstatistics calculated is between the lower and upper critical bounds consistent with extant studies, the error correction mechanism with interaction generated from Eqs. 9 and 10 is given as thus:
$${\Delta lnQ}_{t}={\theta }_{0}+{\psi }_{1}{ecm}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lntrade}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{v}{\delta }_{6i}{\Delta lncrisi}_{5ti}+{\varepsilon }_{2t}$$
(13)
$${\Delta lnQ}_{t}={\theta }_{0}+{\psi }_{2}{ecm}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lninflow}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{v}{\delta }_{6i}{\Delta lncrisis}_{5ti}+{\varepsilon }_{2t}$$
(14)
While the error correction mechanism with interaction generated from Eqs. 11 and 12 is given as thus
$${\Delta lnQ}_{t}={\theta }_{0}+{\psi }_{3}{ecm}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lntrade}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{v}{\delta }_{6i}{\Delta (lntrade*lncrisis)}_{5ti}+{\varepsilon }_{2t}$$
(15)
$${\Delta lnQ}_{t}={\theta }_{0}+{\psi }_{4}{ecm}_{t1}+\sum_{i=1}^{m}{\delta }_{1i}{\Delta lnQ}_{ti}+\sum_{i=1}^{n}{\delta }_{2i}{\Delta lninflow}_{1ti}+\sum_{i=1}^{q}{\delta }_{3i}{\Delta lnk}_{2ti}+\sum_{i=1}^{p}{\delta }_{4i}{\Delta lnl}_{3ti}+\sum_{i=1}^{d}{\delta }_{5i}{\Delta lnpcrd}_{4ti}+\sum_{i=1}^{v}{\delta }_{6i}{\Delta \mathrm{ln}(inflow*crisis)}_{5ti}+{\varepsilon }_{2t}$$
(16)
The coefficient for the error correction term is given as \({\psi }_{1}, {\dots ..\psi }_{4}\). Consistent with extant studies, we expect these coefficient to negative and statistically significant to confirm that the short run disequilibrium is converged to the long run position on a certain speed of adjustment.