Announcement

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

  • Error with code, unsure of issue

    Hi all,

    I'm attempting to run this code:

    * ARDL Models
    forvalues p=1/4{
    forvalues q=1/4{
    qui reg dunemp_JPN 1(1/`p').dunemp_JPN 1(0/`q').dinf_JPN if year>=1946 & year<2016
    qui predict res_`p'_`q' if e(sample)
    di in ye "*******************************"
    di in ye "Model with ARDL(`p',`q'):"
    estat bgodfrey, lag(4)
    estat ic
    di in ye ""
    di in ye ""
    }

    }

    I've seen this same syntax in my lectures yet when I try to run the code stata outputs "1 is invalid name"
    I have recently just started using Stata as part of an econometrics module so I'm unsure of how it works.

    Thanks

  • #2
    I think you need L for lag not the numeral 1. Lower case l looks all too similar to numeral 1. So

    Code:
    qui reg dunemp_JPN L(1/`p').dunemp_JPN L(0/`q').dinf_JPN if inrange(year, 1946, 2015)
    where I've also added use of inrange().

    Comment


    • #3
      Wow that was a embarrassing error, glad it was that simple. Thank you for your help Nick!

      Comment

      Working...
      X