Announcement

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

  • Xtlogit correctly predicted

    Dear stat users,

    I am interested in calculating the correctly called event, false alrams, specifity, sensitivity,etc for the fixxed effect logit.
    I want to calculate something like below.

    probit event var1 var2 var3 var4, nolog

    estat classification, cutoff(.1)

    Click image for larger version

Name:	111pr.PNG
Views:	1
Size:	21.5 KB
ID:	1529667



    Is there anyway to get this Statistics for the fixed effect logit or should I do it manually?







  • #2
    You do not tell us what estimation command you are using for your "fixed effects logit".

    Suppose you are running logit. Then if you look at the output of help logit postestimation you will see details about the "postestimation" commands that can be run following the logit estimation command. In the case of logit you will see that estat classification can be run, presumably producing results similar to what you show in your example running it after probit.

    If, however, this question is a continuation of the question you asked earlier at

    https://www.statalist.org/forums/for...ics-for-xlogit

    where you were running xtlogit, it appears from the output of help xtlogit postestimation that estat classification will not help you in those circumstances.

    With 94 posts to your credit, it seems appropriate to ask you to take a few moments to review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question.

    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    Comment


    • #3
      I am using:

      xtlogit event var1 var2, fe

      then I can get hte predicted probability by using:

      predict probability, pc1

      and then diffine a threshold and see if the event are correctly called or not by cheking manually. So, my question was how to find a shorter way to look at the correctly called event like fot the simple logit and probit model. In other words, what's the quivalent solution for estat calssification in the panel data setting.



      Comment


      • #4
        Dear Arbnor Gashi

        I am afraid you cannot get predicted probabilities after xtlogit with fe. The reason for that is given here.

        Best wishes,

        Joao

        Comment


        • #5
          Maybe that's just a problem for Stata since I've read some academic paper which uses fixed effect logit to predict crises. As for predicted probability, what about pc1 command. Doesn't that give the predicted probability?

          Actually I found a way how to do that but is very time consuming. First I calculate the predicted probability by using the command pc1 then generate crises episodes by checking if the predetermined threshold is passed, and at the end count the event and non event periods that are correctly called by using the command count if event==1&predict==1 or
          event==0&predict==0. P.S. in the previous task I excluded the events when non predicted probability was generated due to missing data.

          Comment


          • #6
            Dear Arbnor Gashi,

            The problem is not restricted to Stata; you simply cannot do it unless you have large T. I would be interested to see the academic paper you mention.

            Best wishes,

            Joao

            Comment


            • #7
              Dear Joa,

              I have some questions regarding in and out of sample prediction.

              First the paper I mentioned above is:
              Comelli (2014); Comparing the Performance of Logit and Probit Early Warning Systems for Currency Crises in Emerging Market Economies.

              In this paper, Comelli has a large number of observations because of data frequency (monthly). Wheres in my case the data frequency are lower (yearly). In my case the dependent variable contains 1,428 observations for 31 countries (118
              crises and
              1310
              non-crises
              ). Using probit model some observations are dropped due to missing data for independent variable and I am left with 1284 (111
              crises and
              1173
              non-crises
              ).

              In my model I am trying to get the predicted outcomes and fit the in-sample-model with lowest total misspecification error and use that model for out-of-sample prediction of crises. I did something like below:

              probit event var1 var2 var3 if year<=1999
              estat classification , cutoff(.11)
              estat classification if year>1999, cutoff(.11)

              I have some questions regarding this model. First, since I have a panel dataset, is it ok to use the probit command instead of xtprobit? I have recognized that the significance and magnitude of variable doesn't change at all. Furthermore, I can get the predicted outcomes easily by using the command estat classification when probit is used .
              Second, is it ok to predict crises using the observations I have in my sample? Before 1999 I have 702 observations (75 crises and
              627
              non-crises), whereas after 1999 I have 582 observations (
              36 crises and
              546
              non-crises
              ).

              Note: I will use different sample size to test predictive ability of the model and I'll actually use the model for the lower time frame predications, i.e. run the model till 1999 then predict crises for the 5 following years, then run the model till 2004 and predict crises for the following 5 years and so forth.

              P.S. Please let me know if you know any good paper regarding my problem or if you have any suggestions how to proceed further (how can I predict crises based on the macro and financial variables).


              Thanks in advance,

              Arbnor




              Comment


              • #8
                If you have 20 or 30 observations by country, you might as well use logit or probit with a dummy for each country; that will make everything easy. Note, however, that this approach really relies on a large number of observations for each group. If you want to learn more about this google "incidental parameter problem logit".

                Comment


                • #9
                  Most of the countries have 49 observations (1970-2018). There are just 4 east European countries for which the data start from 1992.
                  I don't clearly get what you mean by logit and probit with a dummy. Could you please explain it a bit?

                  Comment

                  Working...
                  X