Announcement

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

  • ARIMA Modelling with Binary Independent Variable

    I am trying to fit an ARIMA model to my intervention analysis but when I use the syntax and add both a dependent and independent variable in the command, then it says my binary independent variable has an unknown weight type. Even when I try to add iweight, it still does not work?

    Does anyone have any suggestions of how to run an ARIMA model with both a dependent variable and a binary independent variable?

    Thanks

  • #2
    You can look into the user written Intervention time-series models command tstf (from SSC - type ssc install tstf in Stata). You can run an arima with an intervention date.

    For more details see

    https://www.stata.com/meeting/nordic...tic17_Zhou.pdf

    Hope this helps,
    Justin

    Comment


    • #3
      Thank you Justin!

      I am receiving "weights not allowed" from stata

      This is a dataex of my data:
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input double OverallInflation float n
      26.7   1
      26.8   2
      25.5   3
      25.2   4
      22.6   5
      23.2   6
      22.6   7
      25.8   8
      23.4   9
      20.2  10
      17.5  11
      15.5  12
      15.5  13
      16.2  14
      17.2  15
      16.1  16
      15.4  17
      15.6  18
      14.5  19
      15.1  20
      15.4  21
      12.9  22
        12  23
      11.5  24
       9.6  25
       9.8  26
      10.2  27
       9.8  28
         9  29
       8.5  30
       8.7  31
         9  32
       9.2  33
      10.1  34
      10.2  35
      10.7  36
      11.1  37
      11.3  38
      11.6  39
      11.3  40
      10.9  41
      12.2  42
      12.8  43
      13.7  44
        14  45
      14.2  46
      14.9  47
      15.3  48
      15.5  49
      15.9  50
      15.6  51
      15.4  52
      15.8  53
      15.9  54
      16.2  55
      16.5  56
      16.7  57
      17.1  58
      16.6  59
      16.1  60
      15.8  61
      15.3  62
      14.9  63
        12  64
      11.6  65
        11  66
      10.5  67
      10.1  68
       9.6  69
       9.2  70
       8.6  71
       8.4  72
       7.9  73
       7.7  74
       7.4  75
       7.2  76
       7.1  77
       7.2  78
       7.4  79
       7.5  80
       7.7  81
         8  82
       8.2  83
       8.1  84
       7.9  85
       8.5  86
       8.7  87
       9.1  88
       9.3  89
       9.4  90
       9.6  91
       9.9  92
      10.1  93
       9.7  94
       9.5  95
       9.2  96
       8.7  97
       8.4  98
         8  99
       7.8 100
      end
      I want to do a tstf intervention analysis with an arima model(3,1,0) and a intervention date (n=85)

      I hope you can help me solve this problem

      Thanks

      Comment


      • #4
        Try

        Code:
        tsset n
        gen intervention = (n >= 85)
        arima OverallInflation intervention, arima(3,1,0)
        You could also make intervention = 1 in period 85 with
        Code:
        gen intervention = (n == 85)
        Normally you'll want to use factor notation, but arima doesn't support it. So just have dummy as regressor.
        Hope this helps

        Comment


        • #5
          Thank you very much!

          Comment

          Working...
          X