Announcement

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

  • Having troubles with ivreg2

    I have installed the newest version of ivreg2 (version 4.1.10 9Feb2016) and have run a code that was running fine with a previous version. The code now does not run and I get the error message "variable endo not found". I cannot find a solution online.

    Any suggestion?

    Thanks

    Franco



  • #2
    Hello Franco,

    Welcome to the Stata Forum/Statalist.

    Please provide the "exact" command and the data (or at least a toy example) , as recommended in the FAQ.

    You may use the CODE delimiters or install the SSC dataex.





    Best regards,

    Marcos

    Comment


    • #3
      Below is th ecommand that I use. There are two endogenous variables L1.gdl and Dver (the model is expressed in first differences):

      xi: ivreg2 D1.(gdl inapp free Nidfp1 L1.rat) i.t (D1.(L1.gdl Dver) = ///
      D2.ownDver D2.sprod D2.L1.owngdl L2.(gdl Dver) D1.L1.agever D1.L1.ver) if platform==0, gmm2s cluster(idf) ///
      savefprefix(first)

      Comment


      • #4
        Hello Franco,

        Today, I feel to be under a guessing mood. Considering I don't have much expertise with ivreg2, here are my suggestions:

        You may perhaps avoid using the xi: prefix. Logically, and following the recommendations written in the FAQ, I assume you are using Stata 14.2.
        Maybe you are copying and pasting in the the Command Window a code directly taken from a do-file. If so, you may wish to edit the command line accordingly.
        It may well be the option "endog", instead of "endo".
        I see ".t" before a variable, and that strikes me as a potential mistype.
        Please re-check the correctness of the command overall. Here, I share the help files.

        Hopefully that helps.

        P.S.: as kindly suggested in #2, please use the CODE delimiters or install the SSC datex so as to share command and results. Thanks.
        Last edited by Marcos Almeida; 22 Feb 2017, 08:48.
        Best regards,

        Marcos

        Comment


        • #5
          Dear Marcos,

          Thanks so much for your help. I know that xi: is no longer necessary but I used in the past and remained in some of my do files. I had no problem (and neither my coauhtors) in running that code with previous versions of Stata. I have now (as you correctly pointed out) downloaded Stata 14.2 and find that ivreg2 is no longer working. The command i.t only indicates time dummies (which can beinlcuded also in a first difference model).

          The error message is "variable endo not found".

          Best wishes,

          Franco

          Comment

          Working...
          X