Announcement

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

  • "xttobit" and "predict"

    Dear Stata users,

    I would really appreciate some guidance about how to use the "predict" command after "xttobit". I (think that) have succeeded with the following
    Code:
    predict y_hat, xb
    predict STDP, stdp
    predict STDF, stdf
    In those cases I have not obtained any error messages. However, I have not succeded with the following
    Code:
    predict P, pr0(0,.)
    predict E, e0(0,.)
    predict y_hat_2, ystar0(0,.)
    Also, I have not been able to use the "if e(sample)" option.

    Could any user please provide a simple example on the usage of these options?

    Thanks in advance.

    Regards,
    Cruz


  • #2
    The output of help xttobit postestimation no longer shows pr0, e0, or ystar0 options - it shows only pr, e, and ystar. This change was made to Stata 14.1 on 29 October 2015. So if you are running that version of Stata or later, you should change your options accordingly.

    With regard to "if e(sample)" Stata's "if clause" is not an option and it should appear before the comma that separates options from the main command, thus
    Code:
    predict y_hat if e(sample), xb

    Comment


    • #3
      Dear William Lisowski,

      I think that I understand. Thanks for your response. By the way, would it be possible to know the programming behind the following commands?
      Code:
      predict E, e(0,.)
      predict y_hat_2, ystar(0,.)
      I have succeeded in replicating the results of those commands after running a tobit model estimation by applying the formualae shown in a standard econometrics textbook. That is to say, the predicted values that I obtained on my own are, respectively, equal to those provided by such commands. However, I have not been able to do the same after running an xttobit model estimation.

      Any help on this would be much appreciated.

      Regards,
      Cruz

      Comment


      • #4
        Perhaps the material in the subsection on predict within the section on xttobit postestimation in the Stata Longitudinal-Data/Panel-Data Reference Manual PDF will help your understanding. The PDF is included with your Stata installation and accessible from the Stata Help menu.

        Comment


        • #5
          Dear William Lisowski,

          Thanks for your response, but no formulae for predictions are shown in the PDF file that you are mentioning. I was thinking about something similar to Eqn. (17.24) on p. 598 and Eqn. (17.25) on p. 599 in J. M. Wooldridge (2012), Introductory Econometrics. A Modern Approach. 5th Ed. South-Western CENGAGE Learning. I really appreciate your help. I will keep on trying.

          Regards,
          Cruz

          Comment


          • #6
            Here is a link to an online copy of the current version of the subsection of the Stata Longitudinal-Data/Panel-Data Reference Manual PDF to which I referred. On pages 5-6 of this PDF, in the section titled Methods and Formulas, are equation (1) for pr(), equation (2) for e(), and an expression for ystar() in terms of pr() and e().

            https://www.stata.com/manuals/xtxtto...estimation.pdf

            Comment


            • #7
              Dear William Lisowski,

              Thanks a lot for your help. The answer was just in front of my eyes, and I was not capable to see it. "The test is passed". The key was noticing that the standard deviation of the sum equals the square root of the sum of the variances (!) [bottom of page 5]. Please accept my apologies for having bothered you with such a silly question.

              Yours thankfully,
              Cruz

              Comment

              Working...
              X