Announcement

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

  • ARIMA issue - Predict command not working

    Hi,

    I have quarterly data over the Retail Price Index of a territory, and I built an ARIMA model. Now I'm trying to do forecasting, and of course, I turned to the Predict command after first estimating the Arima model I wanted to use. My RPI data only goes up until the first quarter of this year, ie Q1 2022, so I'm trying to predict the data for the future quarters.

    I used the command:
    predict chatdy, dynamic(tq(2022q2)) y
    Now, this does generate a new variable called chatdy, but when I go to the Data Editor, this variable ALSO only has data up until Q1 2022 - it doesn't predict the future values.

    Clearly I'm doing something wrong and probably something really elementary, but can anyone tell me what?

    Prior to doing this but after running the ARIMA regression I used
    predict chat, y
    predict stdp
    twoway lfitci gdp chat, stdp || scatter gdp chat
    I used the tsset command for the quarterly variable.

    What do I need to do?

  • #2
    I'm unsure of what "does not working" is meant to mean here. You must the FAQ on how to ask questions, precisely sections 12-15.


    Once you've provided a data example (properly formatted) as well as the code and error Stata returns (also properly formatted), I'm more than happy to see if we can solve this.

    Comment


    • #3
      Sorry for being vague. There is no error returned by STATA per se (no error message), it's just that I'm trying to predict, and using the predict command is not giving me any values for future data when I go to the Data Editor (the variable created by the predict command only covers the same time period as the original variable that I am trying to forecast).

      Comment


      • #4
        What you want is not predict but rather forecast, which is designed for what you are doing.
        Code:
        help forecast

        Comment


        • #5
          Interesting, I was basically following a guide on ARIMA estimation and forecasting in stata which used the predict command, but I am wrecking my head here thinking of what I might have done wrong.

          Comment


          • #6
            Good point, I had not read post #1 carefully enough. Ignore the advice in post #4; my apologies.

            The predict command will not add new observations to your dataset - how would it know how many to add? So the first question is, does your dataset have observations for quarters after 2022q1?

            If it does, then the advice from Jared Greathouse in post #2 pertains. Can you create a reproducible example and provide the code and data?

            Be sure to use the dataex command to provide data. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, dataex is already part of your official Stata installation. If not, run ssc install dataex to get it. Either way, run help dataex and read the simple instructions for using it.

            And be sure to surround example of your code with code delimiters [CODE] and [/CODE], which are automatically included the dataex output that you copy and paste into the post.

            Comment


            • #7
              ... yeah, that did it. Thank you so much. Like I said in my original post, the answer was probably something elementary.

              I will be back next week with my next elementary mistake, so stay tuned... :P

              Comment

              Working...
              X