Announcement

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

  • xtabond2 - interactions not allowed and error r(101)

    Hi everyone,

    I am not able to run the xtabond2 command when using an interaction between a dummy and continuous variable. The outcome shows "interactions not allowed and error r(101)". May I know the possible reasons and how can i solve it (without having to create a new variable x7 = dummy*x6)?



    Code:
    xi: xtabond2 x1 l.x1 l.x3 l.x4 l.x5 dummy##l.x6 i.year, gmm (.x1 l.x3 l.x4  l.x6 ) iv( l.x5 i.year) noleveleq nodiffsargan twostep robust

  • #2
    Nuno:
    the community-contributed module -xtabond2- does not seem to support -fvvarlist- notation.
    Therefore, you have to create interactions by hand.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Alternatively, you can use my xtdpdgmm command instead of xtabond2.
      https://www.kripfganz.de/stata/

      Comment


      • #4
        xtabond2 does accept factor variables.

        Example:
        Code:
        webuse abdata
        gen d = runiform()>.5
        xtabond2 n d##c.l.n l(0/1).(w k) yr1980-yr1984, gmm(n w k) iv(yr1980-yr1984, mz) robust twostep small h(2)
        Looking at the line in your post, I would expect ".x1" to cause an error. Also, "dummy##l.x6" will cause an error if either dummy or x6 contains non-integer values. If x6 contains non-integer values, you may mean dummy##c.l.x6.

        I would suggest taking the command line that is causing the error and changing it just enough to make it into a -regress- or ivreg command line, to make sure your specification of factor variables is correct. If you get the same error message, then it's not an xtabond2 issue.

        Comment


        • #5
          Hi Everyone, sorry for the late response

          I actually found the "problem", the stata comand was not updated so I was not able to create interactions.
          For those with a similar problem, just use the following code after updating the Stata.

          HTML Code:
          ado update xtabond2, replace
          Thank you all for your suggestions and availability.

          Comment

          Working...
          X