Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with PVAR and the Hansen J test

    Hello everyone! I am someone who does not know Stata or any other programming language at all and I have been dependent on CHAT-GPT for the codes. I am facing an issue while running a code. I have a panel data in the following structure:
    Click image for larger version

Name:	Data.png
Views:	1
Size:	109.8 KB
ID:	1765088



    The data in the image has a total of 15466 rows and there is data from 5 countries (France, Germany, UK, USA and Japan) I am trying to run a vector auto regression model on the above panel data with W_Excess_returns (winsorised excess returns), GDP growth, Inflation rate and Interest rate. What I want to do is see whether excess returns are explained by GDP growth, inflation rate and interest rates along with their lags to capture the lagging effect.

    I ran a very basic code in stata using pvar, the code is below:

    pvar W_Excess_returns GDP_growth Inflation_rate Interest_rate, lags (2) overid

    the output for the hansen J test is provided below:
    Click image for larger version

Name:	HJ Test stata.png
Views:	0
Size:	0
ID:	1765094

    I have a few questions:
    1. Is my code correct? I think it looks fine but not sure. if not what is the correct code?
    2. Is the output correct considering the results of the hansen test?
    3. How do I fix the Hansen test results?
    4. How do I improve the code? Is it even possible?
    I understand these are really basic questions but I really need help!

    Thank you!
    Last edited by Tanay Kadakia; 04 Oct 2024, 14:01.
Working...
X