Announcement

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

  • Panel Threshold Model xthreg - problems balanced panel

    Good evening,

    I am studying the relation between debt and growth. I would like to find an endogenous debt-threshold using Hansen's (1999) technique.
    I have found the command xthreg to do so. However, when I try to run the regression I get the following message:


    . xthreg growth expldebtGDP logkf humank depratio crisis, rx(growth) qx(expldebtGDP)
    Panel threshold model need balanced panel, check your data!

    Maybe I am misusing the option rx(...). it should reflect the regime dependent variable (and I think it is growth, as growth depends on the debt-level regime?)

    I do not understand why it does not accept my data as balanced. When I started my analysis I got the confirmation that it is strongly balanced:


    . xtset country year
    panel variable: country (strongly balanced)
    time variable: year, 1995 to 2015
    delta: 1 unit


    Do I have to delete all observations where I have missing values? (there are only a few).

    I appreciate your help,

    Regards,

    Justine Bulkaert.

  • #2
    I have never used the command but my guess is that if there is missing data the panel will no longer be balanced. My further guess is that you would have to delete all records for a panel id if even only one of its records had missing data, e.g. if case 1 in 1997 had missing data, you would have to delete all records for case 1 for 1995-2015. There is probably some clever way to do that via egen commands but off the top of my head I don't know what it is. It might be a nice option for xthreg if it allowed you to drop IDs with records that were not balanced.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      I think something like this can get you a balanced panel with all panel ids with any MD deleted. Just be sure to include all the vars you will be using in the gen command.

      Code:
      use http://www3.nd.edu/~rwilliam/statafiles/bollenbrand, clear
      xtset
      xtdes
      gen md = missing(hchild, lnwg, break)
      bysort id (md): keep if md[_N] == 0
      xtset
      xtdes
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Thank you for your answer.

        Could you also help me with respect to the rx(.) option ? it is supposed to define the regime specific variable. However in some examples I have seen that the variable wich is inside rx(.) is not included in the regression. therefore, I am starting to think that I should not write rx(growth). I have some difficulties understaning the rx(.) command.

        Excuse me fore these stupid questions. I am quite new to stata.

        Regards,

        Justine Bulkaert.

        Comment


        • #5
          Sorry, I have never used the program before. You might find an answer in the help file or in the Stata Journal article:

          http://www.stata-journal.com/article...article=st0373

          Alas, the article costs money if you don't have an SJ subscription.

          Perhaps someone who is more familiar with the program will come along and be able to help you.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            1. I think that Richard was right about missing data in the sample. Try to use the command "xtbalance" (ssc install balance) to obtain balanced panel data for use of "xthreg".
            2. The variable in rx(var) is, by definition, (with) regime-specific (coefficients), and, as a result, should not be included in the regression (with constant coefficient). Try (debt-to-GDP ratio serves as the threshold and also the regime-specific variable:
            HTML Code:
             xthreg growth logkf humank depratio crisis, rx(expldebtGDP) qx(expldebtGDP)
            Last edited by River Huang; 16 Aug 2016, 21:52.
            Ho-Chuan (River) Huang
            Stata 19.0, MP(4)

            Comment


            • #7
              Dear Mr
              i have applicate the "xthreg" but i dont have the esimation of parameters in the two regime
              i used this commande
              xthreg d_exchange d_ln_TNT d_ln_TOT d_OPEN d_NFA, rx(d_GOV) qx(d_GOV) thnum(1) trim(0.01) grid(400) bs(300)

              Comment


              • #8
                Hi Justin,

                Did you find the answer w.r.t the rx command? I am confused with the same.

                Cheers,
                Anum

                Comment


                • #9
                  Click image for larger version

Name:	xt.PNG
Views:	2
Size:	4.5 KB
ID:	1433595

                  Dear all

                  when i try to install "xthreg", i get this message
                  what wrong with it ? ( i'm using stata 12.0)

                  best regards
                  Sedki

                  Comment


                  • #10
                    The message you received is telling you that the package -xthreg- is not found at ssc.

                    First type -ssc describe xthreg- and you'll see this message:

                    ssc describe: "xthreg" not found at SSC, type search xthreg
                    (To find all packages at SSC that start with x, type ssc describe x)
                    r(601);

                    Then, follow the advice to type -search xthreg-

                    You'll see a link to a page that allows you to install -xthreg-

                    Comment


                    • #11
                      Click image for larger version

Name:	nj.PNG
Views:	1
Size:	5.3 KB
ID:	1433712


                      Thanks, i did it but i think the 12.0 stata version do not run it :/

                      Comment


                      • #12

                        . xthreg rgdp inf ge inv gdppercap trade, rx(debt) qx(debt) thnum(1) trim(0.05) bs(300)
                        unknown egen function sd()
                        r(133);

                        .
                        Why do I keep receiving this return from Stata. I am examining the threshold of debt to real gdp.
                        Many thanks

                        Comment


                        • #13
                          Hello,
                          I am new to Stata. I am currently working on a problem where i need to use xthreg command in stata. I need a sample balanced panel data file and syntax to run on that data file. Can someone please help urgently.

                          Comment


                          • #14
                            Hello, prof. River Huang and Richard Williams

                            Please, kindly help.
                            Can I use the threshold model (developed by Hansen (2000) "Sample splitting and threshold estimation. Econometrica 68 (3), 575-603) with time-series data? I know that the command " xthreg" is only used for panel data. If it is able to be used with time-series data, what type of command in stata should I use? I would like to thank you in advance.
                            Last edited by LEANGHAK HOK; 20 Mar 2019, 10:58.

                            Comment


                            • #15
                              Sorry, I have no idea. You may be better off starting a new thread rather than adding on to a very old one. Also make the subject something that corresponds more closely to what you are asking.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              StataNow Version: 19.5 MP (2 processor)

                              EMAIL: [email protected]
                              WWW: https://www3.nd.edu/~rwilliam

                              Comment

                              Working...
                              X