Announcement

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

  • How to find fitted values after -nlcom-?

    Hi,

    I am using the command -xtpmg- to estimate an ECM-type mean-group estimator.
    When estimating the model, the command first estimates the unrestricted model for all N, then adds restrictions using -nlcom-, and then it finally averages the coefficients.

    I want to se how the model fits the data, but using -predict, xb- gives meaningless results.

    I'm guessing the problem lies in using -predict- after -nlcom-, as I get the error "predict not allowed after posting nlcom results" if I try to estimate an ECM-model with -nlcom-.

    Any suggestions on how to find fitted values after either -nlcom- or -xtpmg-?

    Thanks!

  • #2
    after -nlcom-, you want -predictnl- not -predict-

    you need to explain where you got -xtpmg- which is a user-written program (see the FAQ); did the user supply their own post-estimation commands?

    Comment


    • #3
      Thank you for answering!
      -predictnl- seems to work when I do it manually on separate time-series.

      However, for the panel data set, i need the -xtpmg- to average coefficients and calculate new standard errors.

      Here are references to -xtpmg-:
      - Help dialog: http://fmwww.bc.edu/repec/bocode/x/xtpmg.html
      - Stata Journal: http://www.stata-journal.com/sjpdf.h...iclenum=st0125

      I can't se anything about post-estimation in the dialog. I have tried calculating the fitted values manually as well, but it fails as the estimated long-run coefficients don't seem to be stored in memory..

      Comment


      • #4
        if you go into the pdf of the article and search on "predict" you will see their recommendation; there is nothing further I can tell you as I have never used this command

        Comment


        • #5
          Thank you for pointing that out! I just tried, and as they say in the article - this works fine!

          However, they are refering to post-estimation after using the PMG option (pooled-mean-group), and not the MG (mean group).
          When using the PMG option, you restrict identical long-run behaviour across panels, while short-run coefficients are free to vary.
          With the MG option, both short- and long-run coefficients are free to vary.
          Using - predict newvar if id=1, eq(id_1) - with the former option, you only have one equation for each id - so it works!
          But when using it after the latter (MG) option, there are two equations to be fitted - both the long-run and the short run.
          In the estimation results, there are two groups of coefficients - first the long-run coefficients, then the short-run.

          How can I refer to multiple equations with - predict -?

          Comment


          • #6
            read -h predict- and you will see that one set of instructions as to do with multiple equations models

            Comment


            • #7
              Once again, thanks for following up on this one - I really appreciate it!

              I've read the dialog for predict, but it is not clear to me how to include both equations in the fitted values. -predict phat if id==1, eq(id_1, id_2)- does not work.
              One possibility would be to first run predict on the short-run coefficients, then on the long-run, and finally combine them in some way. But it is not clear how to combine them.
              It might be illustrating to look at (parts of) my output:



              The upper equation ("region_19__ec") show the long-run relationhip, the lower ("region_19SR") the short-run. The first coefficient of the lower panel, - __ec -, shows how the dependent variable error corrects toward the long-run relationhip.

              If I first run -predict phat_LR if region==19, eq(region_19__ec)-, and then -predict phat_SR if region==19, eq(region_19SR)-, it is not clear to me how I can combine them afterwards. Any suggestions?

              Comment


              • #8
                Apologies for reviving this old thread, but did you manage to find a solution for the problem? I am struggling with the same.

                Comment

                Working...
                X