Announcement

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

  • Error r(3301)

    Hello everyone,

    I am trying to run a cointegration with panel data using the xt function on a dataset which includes different countries and years. After using xtset with country and year, I try to run xtcointreg with some of the variables and stata returns the following:

    Code:
    . xtcointreg var1 var2 var3
                      xlag():  3301  subscript invalid
                autobwidth():     -  function returned error
               lrcovkernel():     -  function returned error
                    _lrcov():     -  function returned error
                  cointreg():     -  function returned error
                     <istmt>:     -  function returned error
    r(3301);
    I manually checked the dataset, and it seems everything is fine. How can I solve this?

    Thank you for your help

  • #2
    Hi,
    I am getting the following error when I run the xthenreg command in STATA:

    xthenreg ltfp lgdppc lmaxtemp pc1 inflation lprecip, endo(ltradetogdp) inst(kaopen L2.ltradetogd
    > p) kink
    maincode_0719(): 3301 subscript invalid
    <istmt>: - function returned error
    r(3301);
    Could somebody help?

    Comment


    • #3
      Looking for more information about the error 3301 (e.g. via -error 3301-) reveals that it is a Mata run-time error:
      Code:
      [M-2]   error . . . . . . . . . . . . . . . . . . . . . . . . Return code 3301
              subscript invalid
              The subscript is out of range (refers to a row or column that
              does not exist) or contains the wrong number of elements.
              See help [M-2] subscripts.
      that should not happen if the programmer did anticipate such error (which is sometimes hard to do). Beyond that, I can't help.

      Please note that you should have mentioned that you (as well as Stefano Pagliarani) are using a user written program available at ? (please read the Forums's FAQ before posting) and that Stata is no acronym but a name.

      Comment


      • #4
        xthenreg is community-contributed


        Code:
        SJ-19-3 st0573  . . . . . . . . .  Estimation of dynamic panel threshold model
                (help xthenreg if installed)  . . . . M. H. Seo, S. Kim, and Y.-J. Kim
                Q3/19   SJ 19(3):685--697
                implements the first-differenced generalized method of moments
                estimation of the dynamic panel threshold model that Seo and
                Shin (2016, Journal of Econometrics 195: 169-186) proposed
        Some things that may or may not be practicable:

        Post a minimal dataset here that reproduces the problem.

        Contact the program authors for support with a copy of your dataset.

        Code:
        set trace on 
        set tracedepth 1
        to see exactly where the command fails. It's failing (deep?) inside Mata code. You may need to bump up tracedepth.

        Discuss the variables. If the prefix l means logarithm, I wonder about the rationale for logging max temperature (even if all temperatures are reported positive). The logarithm of Celsius or Fahrenheit temperature seems unlikely to relate well to social science outcomes and predictors. Even if your units are kelvin, I doubt that maximum temperature has enough range for logarithms to make a difference,

        Is precipitation ever zero?

        Check for the command's behaviour in the face of possible missing values and very short panels.

        Comment

        Working...
        X