Announcement

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

  • xtabond2, gmm specification, and predict

    I am using the xtabond2 command (Stata 11.2) on a panel dataset with 48 units and 39 observations per unit (balanced panel), such as:

    xi: xtabond2 dep_var l(1/2).dep_var i.year_month, gmm(dep_var, lag(3 4)) iv(i.year_month) robust twostep

    The results work/meet expectations. I now want to estimate dep_var forward (out of sample) using "predict" and can do so for one period, but get blanks "." in the predicted variable for more than one period. I've followed prior threads on creating dummy variables for the "i.year_month" variable and have also tried to use stand alone lagged values (e.g. "lag3_dep_var = l3.dep_var") of the dependent variable in xtabond2 (see below). But, I get the following error (see below):

    xi: xtabond2 dep_var l(1/2).dep_var i.year_month, gmm(dep_var, lag(lag3_dep_var lag4_dep_var)) iv(i.year_month) robust twostep

    Laglimits(lag3_Net_Revenue_pu lag4_Net_Revenue_pu) invalid.
    r(198);

    My questions are:

    1. is there better syntax for inserting lagged values in the "gmm" option of xtabond2?
    2. is there a more appropriate way to create multi-period forecasts for xtabond2?

    Todd Sears

  • #2
    Todd, I'm guessing that the problem is that using the xi: prefix creates temporary "_I" variables, which Stata destroys as soon as xtabond2 is finished. Then when predict runs, it can't find those variables. Prefixing the predict command with xi might not help because the temporary variables created this time might have different names. If you're using Stata 11 or later, you don't need the xi prefix. Just drop it.
    The laglimits() option only accepts numbers or missing.
    --David

    Comment


    • #3
      Thanks, I'll try creating the _I variables directly/separately prior to executing predict or go with time dummies. By the way, great command/addition to Stata - thanks for not only taking the time to put it together but the documentation posted on line is really helpful!!

      Comment

      Working...
      X