In the Engle-Granger test, you need to ensure that all variables involved are non-stationary. This includes both the dependent variable (y) and the independent variables (x).
The Engle-Granger test is a cointegration test that determines whether there is a long-term relationship between two or more variables. Cointegration requires that all variables are non-stationary, meaning they have a unit root in their time series data. If any of the variables are stationary, then the Engle-Granger test cannot be applied.
To check stationarity in R, you can use various methods such as the Augmented Dickey-Fuller (ADF) test or the KPSS test. These tests help determine if a variable is non-stationary.
Here's an example of how to perform the Engle-Granger test in R, assuming you have already checked for stationarity:
161 chars9 lines
Make sure to replace data
with your actual dataset containing both the dependent and independent variables.
Remember, the Engle-Granger test assumes that the variables are cointegrated, meaning they have a long-term relationship. If the variables are not cointegrated, then the test may produce misleading results. Therefore, it is important to interpret the results carefully and consider other factors when analyzing the relationship between your variables.
gistlibby LogSnag