The symmetry test is a statistical procedure used to assess the presence of symmetry in the relationship between variables in a model. It is particularly useful in econometric analysis, where it helps to identify whether the effects of changes in one variable on another are symmetric or asymmetric. The test involves estimating a model that includes both positive and negative components of the variables and then performing a Wald test to determine if the coefficients of these components are significantly different from each other. If the test indicates significant differences, it suggests that the relationship is asymmetric, meaning that the impact of increases and decreases in the variables differs. This test returns results for both long-run and short-run variables in a KARDL model. Where applicable, it provides the Wald test statistics, p-values, degrees of freedom, sum of squares, and mean squares for each variable tested. If the null hypothesis of symmetry is rejected, it indicates that the effects of positive and negative changes in the variable are significantly different, suggesting an asymmetric relationship.
The non-linear model with one asymmetric variables is specified as follows: $$ \Delta{y_{t}} = \psi + \eta_{0}y_{t - 1} + \eta^{+}_{1} x^{+}_{t - 1}+ \eta^{-}_{1} x^{-}_{t - 1} + \sum_{j = 1}^{p}{\gamma_{j}\Delta y_{t - j}} + \sum_{j = 0}^{q}{\beta^{+}_{j}\Delta x^{+}_{t - j}} + \sum_{j = 0}^{m}{\beta^{-}_{j}\Delta x^{-}_{t - j}} + e_{t} $$
This function performs the symmetry test both for long-run and short-run variables in a kardl model. It uses the nlWaldtest function from the nlWaldTest package for long-run variables and the linearHypothesis function from the car package for short-run variables.
The hypotheses for the long-run variables are:
$$
H_{0}: -\frac{\eta^{+}_{1}}{\eta_{0}} = -\frac{\eta^{-}_{1}}{\eta_{0}} $$
$$ H_{1}: -\frac{\eta^{+}_{1}}{\eta_{0}} \neq -\frac{\eta^{-}_{1}}{\eta_{0}}
$$
The hypotheses for the short-run variables are: $$ H_{0}: \sum_{j = 0}^{q}{\beta^{+}_{j}} = \sum_{j = 0}^{m}{\beta^{-}_{j}} $$ $$H_{1}: \sum_{j = 0}^{q}{\beta^{+}_{j}} \neq \sum_{j = 0}^{m}{\beta^{-}_{j}} $$
Arguments
- kmodel
The kardl obejct
- vars
A character vector specifying the names of the variables to be included in the symmetry test. If NULL (the default), all eligible variables will be tested. The variable names should match those used in the KARDL model, and they can be either long-run or short-run variables. If any specified variable is not found in the model, an error will be raised.
- component
A character string specifying which component(s) of the model to test for symmetry. The options are "both" (default), "shortrun", or "longrun". If "both" is selected, the function will perform symmetry tests for both long-run and short-run variables. If "shortrun" is selected, only short-run variables will be tested, and if "longrun" is selected, only long-run variables will be tested. Invalid values will result in an error.
- type
A character string specifying the type of test statistic to be used in the Wald tests. The options are "F" (default) or "Chisq". If "F" is selected, the function will perform an F-test, which is appropriate for smaller sample sizes. If "Chisq" is selected, the function will perform a chi-squared test, which is more suitable for larger sample sizes. Invalid values will result in an error.
- ...
Additional arguments to be passed to the underlying test functions, such as
nlWaldtestfor long-run tests orlinearHypothesisfor short-run tests. These arguments can include options for controlling the behavior of the tests, such as specifying the type of test statistic or adjusting for multiple comparisons.
Value
A list with class "kardl" containing the following components:
Lwald:A data frame containing the Wald test results for the long-run variables, including F-statistic, p-value, degrees of freedom, and residual degrees of freedom.Lhypotheses:A list containing the null and alternative hypotheses for the long-run variables.Swald:A data frame containing the Wald test results for the short-run variables, including F-statistic, p-value, degrees of freedom, residual degrees of freedom, and sum of squares.Shypotheses:A list containing the null and alternative hypotheses for the short-run variables.
Details
This function performs symmetry tests on non-linear KARDL models to assess whether the effects of positive and negative changes in independent variables are statistically different.
This function evaluates whether the inclusion of a particular variable in the model follows a linear relationship or exhibits a non-linear pattern. By analyzing the behavior of the variable, the function helps to identify if the relationship between the variable and the outcome of interest adheres to a straight-line assumption or if it deviates, indicating a non-linear interaction. This distinction is important in model specification, as it ensures that the variable is appropriately represented, which can enhance the model's accuracy and predictive performance.
References
Shin, Y., Yu, B., & Greenwood-Nimmo, M. (2014). Modelling asymmetric cointegration and dynamic multipliers in a nonlinear ARDL framework. Festschrift in honor of Peter Schmidt: Econometric methods and applications, 281-314.
Examples
kardl_model<-kardl(imf_example_data,
CPI~Lasym(PPI+ER)+Sas(ER)+deterministic(covid)+trend)
ast<- symmetrytest(kardl_model)
ast
#>
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.00093159 0.00093159 4.2217 0.04049 *
#> PPI 1 0.00002915 0.00002915 0.1321 0.71644
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Symmetry Test Results - Short-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.0021074 0.0021074 9.5499 0.002124 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
# Detailed results of the test:
summary(ast)
#> Long-run symmetry tests:
#>
#> Test for variable: ER
#> F statistic: 4.221689, p-value: 0.04048856
#> Test Decision: Reject H0 at 5% level. Indicating long-run asymmetry for variable ER.
#> Hypotheses:
#> H0: - Coef(L1.ER_POS)/Coef(L1.CPI) = - Coef(L1.ER_NEG)/Coef(L1.CPI)
#> H1: - Coef(L1.ER_POS)/Coef(L1.CPI) ≠ - Coef(L1.ER_NEG)/Coef(L1.CPI)
#>
#> Test for variable: PPI
#> F statistic: 0.1320953, p-value: 0.7164405
#> Test Decision: Fail to Reject H0 at 5% level. Indicating long-run symmetry for variable PPI.
#> Hypotheses:
#> H0: - Coef(L1.PPI_POS)/Coef(L1.CPI) = - Coef(L1.PPI_NEG)/Coef(L1.CPI)
#> H1: - Coef(L1.PPI_POS)/Coef(L1.CPI) ≠ - Coef(L1.PPI_NEG)/Coef(L1.CPI)
#>
#>
#> _____________________________
#> Short-run symmetry tests:
#>
#> Test for variable: ER
#> F statistic: 9.549852 , p-value: 0.002123947
#> Test Decision: Reject H0 at 5% level. Indicating short-run asymmetry for variable ER.
#> Hypotheses:
#> H0: Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) = Coef(L0.d.ER_NEG)
#> H1: Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) ≠ Coef(L0.d.ER_NEG)
#>
# The null hypothesis of the test is that the model is symmetric, while the alternative
# hypothesis is that the model is asymmetric. The test statistic and p-value are provided
# in the output. If the p-value is less than a chosen significance level (e.g., 0.05),
# we reject the null hypothesis and conclude that there is evidence of asymmetry in the model.
# The default significance level is 0.05, but you can specify a different level using the 'level'
# argument in the summary function. For example, to use a significance level of 0.01,
# you can use the following code:
summary(ast, level = 0.01)
#> Long-run symmetry tests:
#>
#> Test for variable: ER
#> F statistic: 4.221689, p-value: 0.04048856
#> Test Decision: Fail to Reject H0 at 1% level. Indicating long-run symmetry for variable ER.
#> Hypotheses:
#> H0: - Coef(L1.ER_POS)/Coef(L1.CPI) = - Coef(L1.ER_NEG)/Coef(L1.CPI)
#> H1: - Coef(L1.ER_POS)/Coef(L1.CPI) ≠ - Coef(L1.ER_NEG)/Coef(L1.CPI)
#>
#> Test for variable: PPI
#> F statistic: 0.1320953, p-value: 0.7164405
#> Test Decision: Fail to Reject H0 at 1% level. Indicating long-run symmetry for variable PPI.
#> Hypotheses:
#> H0: - Coef(L1.PPI_POS)/Coef(L1.CPI) = - Coef(L1.PPI_NEG)/Coef(L1.CPI)
#> H1: - Coef(L1.PPI_POS)/Coef(L1.CPI) ≠ - Coef(L1.PPI_NEG)/Coef(L1.CPI)
#>
#>
#> _____________________________
#> Short-run symmetry tests:
#>
#> Test for variable: ER
#> F statistic: 9.549852 , p-value: 0.002123947
#> Test Decision: Reject H0 at 1% level. Indicating short-run asymmetry for variable ER.
#> Hypotheses:
#> H0: Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) = Coef(L0.d.ER_NEG)
#> H1: Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) ≠ Coef(L0.d.ER_NEG)
#>
# To get symmetry test results in long-run, you can use the following code:
ast$Lwald
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.00093159 0.00093159 4.2217 0.04049 *
#> PPI 1 0.00002915 0.00002915 0.1321 0.71644
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# To get symmetry test results in short-run, you can use the following code:
ast$Swald
#> Symmetry Test Results - Short-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.0021074 0.0021074 9.5499 0.002124 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# To get the null and alternative hypotheses of the test in long-run,
# you can use the following code:
ast$Lhypotheses
#> $H0
#> $H0$ER
#> [1] "- Coef(L1.ER_POS)/Coef(L1.CPI) = - Coef(L1.ER_NEG)/Coef(L1.CPI)"
#>
#> $H0$PPI
#> [1] "- Coef(L1.PPI_POS)/Coef(L1.CPI) = - Coef(L1.PPI_NEG)/Coef(L1.CPI)"
#>
#>
#> $H1
#> $H1$ER
#> [1] "- Coef(L1.ER_POS)/Coef(L1.CPI) ≠ - Coef(L1.ER_NEG)/Coef(L1.CPI)"
#>
#> $H1$PPI
#> [1] "- Coef(L1.PPI_POS)/Coef(L1.CPI) ≠ - Coef(L1.PPI_NEG)/Coef(L1.CPI)"
#>
#>
# To get the null and alternative hypotheses of the test in short-run,
# you can use the following code:
ast$Shypotheses
#> $H0
#> $H0$ER
#> [1] "Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) = Coef(L0.d.ER_NEG)"
#>
#>
#> $H1
#> $H1$ER
#> [1] "Coef(L0.d.ER_POS) + Coef(L1.d.ER_POS) ≠ Coef(L0.d.ER_NEG)"
#>
#>
# Alternatively, you can also use the symmetrytest function with the component
# argument to specify whether you want to test for long-run or short-run symmetry.
# For example, to test for long-run symmetry, you can use the following code:
symmetrytest(kardl_model, component = "longrun")
#>
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.00093159 0.00093159 4.2217 0.04049 *
#> PPI 1 0.00002915 0.00002915 0.1321 0.71644
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
# To test for short-run symmetry, you can use the following code:
symmetrytest(kardl_model, component = "shortrun")
#>
#> Symmetry Test Results - Short-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.0021074 0.0021074 9.5499 0.002124 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
# If you want to test for symmetry with respect to a specific variable,
# you can use the vars argument in the symmetrytest function. For example,
# to test for symmetry with respect to the PPI variable, you can use the following code:
symmetrytest(kardl_model, vars = "PPI")
#>
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> PPI 1 2.9149e-05 2.9149e-05 0.1321 0.7164
#>
# To test for symmetry with respect to multiple variables, you can provide
# a vector of variable names to the vars argument. For example, to test for
# symmetry with respect to both PPI and ER, you can use the following code:
symmetrytest(kardl_model, vars = c("PPI", "ER"))
#>
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> PPI 1 0.00002915 0.00002915 0.1321 0.71644
#> ER 1 0.00093159 0.00093159 4.2217 0.04049 *
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Symmetry Test Results - Short-run:
#> =======================
#> Df Sum of Sq Mean Sq F value Pr(>F)
#> ER 1 0.0021074 0.0021074 9.5499 0.002124 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
# Finally, you can also specify the type of test statistic to be used in the
# symmetry test. By default, the function uses the Wald test F statistic,
# but you can also choose to use the chi-squared test statistic.
# For example, to use the chi-squared test statistic, you can use the following code:
symmetrytest(kardl_model, type="Chisq")
#>
#> Symmetry Test Results - Long-run:
#> =======================
#> Df Chisq Pr(>Chisq)
#> ER 1 4.2217 0.03991 *
#> PPI 1 0.1321 0.71627
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Symmetry Test Results - Short-run:
#> =======================
#> Df Sum of Sq Chisq Pr(>Chisq)
#> ER 1 0.0021074 9.5499 0.002 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>