Announcement

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

  • export extra statistics from ado file (with different formats)

    Dear All, A new/useful -xthenreg- command (forthcoming in Stata Journal) can be downloaded here (or xthenreg.ado, xthenreg.sthlp). An example is:
    Code:
    webuse grunfeld, clear
    xtset company year
    xthenreg invest kstock mvalue , grid_num(50) trim_rate(0.1) boost(100)
    dis e(boots_p)
    with results
    Code:
    . webuse grunfeld, clear
    
    . xtset company year
           panel variable:  company (strongly balanced)
            time variable:  year, 1935 to 1954
                    delta:  1 year
    
    . xthenreg invest kstock mvalue , grid_num(50) trim_rate(0.1) boost(100)
     
    N = 10, T = 20
    Panel Var. = company
    Time Var. = year
    Number of moment conditions = 207
    Bootstrap p-value for linearity test = 0
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         Lag_y_b |   .7073252   .4841191     1.46   0.144    -.2415308    1.656181
        mvalue_b |    .086302   .0083447    10.34   0.000     .0699467    .1026573
          cons_d |   1983.657   806.0061     2.46   0.014      403.914      3563.4
         Lag_y_d |  -.3786369   .8011415    -0.47   0.636    -1.948845    1.191571
        mvalue_d |  -.1759067   .0497469    -3.54   0.000    -.2734088   -.0784046
               r |      787.3    26.9621    29.20   0.000     734.4552    840.1447
    ------------------------------------------------------------------------------
    
    . dis e(boots_p)
    0
    My first question is how can I obtain the following p-value in format like, say %9.3f (Bootstrap p-value for linearity test = 0) and my second question is: in the ado file, there is a corresponding test statistics `sup_wald_ori'. How can I export it in the same format as the p-value (%9.3f)? Thank you so much!
    Last edited by River Huang; 14 Apr 2019, 17:15.
    Ho-Chuan (River) Huang
    Stata 17.0, MP(4)

  • #2
    Try something like this!

    Code:
    webuse grunfeld, clear
    xtset company year
    xthenreg invest kstock mvalue , grid_num(50) trim_rate(0.1) boost(100)
    
    // change display format
    di %8.4f e(boots_p)
    Output:
    HTML Code:
    N = 10, T = 20
    Panel Var. = company
    Time Var. = year
    Number of moment conditions = 207
    Bootstrap p-value for linearity test = 0
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         Lag_y_b |   .7073252   .4841191     1.46   0.144    -.2415308    1.656181
        mvalue_b |    .086302   .0083447    10.34   0.000     .0699467    .1026573
          cons_d |   1983.657   806.0061     2.46   0.014      403.914      3563.4
         Lag_y_d |  -.3786369   .8011415    -0.47   0.636    -1.948845    1.191571
        mvalue_d |  -.1759067   .0497469    -3.54   0.000    -.2734088   -.0784046
               r |      787.3    26.9621    29.20   0.000     734.4552    840.1447
    ------------------------------------------------------------------------------
    
    . 
    . display %8.4f e(boots_p) 
      0.0000

    Comment


    • #3
      Btw, have you figured out how to identify the threshold point value \(\gamma\)?

      I would love to know where the kink happens!
      Last edited by Suresh Paul; 14 Apr 2019, 20:39.

      Comment


      • #4
        Dear Suresh, Thanks for answering my first question. To answer the second question, we must modify the "xthenreg.ado". Do you know how to do that?


        Ho-Chuan (River) Huang
        Stata 17.0, MP(4)

        Comment


        • #5
          Dear Suresh, I guess that `r' (787.3) in the last row of the result table is what you want.
          Ho-Chuan (River) Huang
          Stata 17.0, MP(4)

          Comment


          • #6


            Dear all

            Finally we get the stata' command to deal with the endogeneity issue for threshold model, but it still not clear
            i mean how can we know if it exists the threshold effect and at which level

            ( using the '' xthreg'' is clear)

            so please how to deal with this output

            kind regards
            Sedki,

            Comment


            • #7
              Dear River Huang ,

              I would like to know the meaning of "b" and "d"? Also, Is the the existence of non linear relationship means the existence of threshold level??

              kind regards
              Fairouz

              Comment


              • #8
                Dear River Huang Suresh Paul
                Is the "mvalue_b" means the variable below the threshold level? kind regards Fairouz

                Comment


                • #9
                  Dear All, Please i'm still struggling how to install the xthenreg command. I read several ways of going about it, but still not successful. I created a folder under personal and kept the commands, I used the sysdir set PERSONAL, and i typed ssc install xthenreg, but I got the message: nothing to install.

                  Please, I need your help. Thank you.

                  Comment


                  • #10
                    Dear @Yazidu,

                    Just type help xthenreg in command window in SATAT and you will get message showing that it is not installed and there is an option install


                    Click on it and it will install it for you.

                    Thanks
                    Sarah

                    Comment


                    • #11
                      sedki zn River Huang Suresh Paul fai ot


                      I am looking for explanation for "b" and "d".
                      Bootstrap p-value for linearity test = 0 "confirms the existence of threshold"
                      r coef, shows threshold level and its respective p value denotes significance of threshold

                      My questions are
                      1. How to explain the relationships below and above threshold level
                      2. How to identify number of thresholds like in "xthreg"
                      3. When we use kink static option model shows only results with b. Is b stands for basic or static model? and kink slope is simple slope of the model?
                      4. What is the role of Number of moment conditions it should be less than "N" or can be more than "N".

                      Thanks in advance. If you can provide your email or social media contact for faster communication it will be highly appreciated.
                      Attached Files

                      Comment


                      • #12
                        Muhammad Bilal Ahsin Did you have any answer on this brother, because I am searching but so far no idea. what b and d means and how to interpret the results!! if you have ideas please share. Thank you.

                        Comment


                        • #13
                          Originally posted by Muhammad Bilal Ahsin View Post
                          sedki zn River Huang Suresh Paul fai ot


                          I am looking for explanation for "b" and "d".
                          Bootstrap p-value for linearity test = 0 "confirms the existence of threshold"
                          r coef, shows threshold level and its respective p value denotes significance of threshold

                          My questions are
                          1. How to explain the relationships below and above threshold level
                          2. How to identify number of thresholds like in "xthreg"
                          3. When we use kink static option model shows only results with b. Is b stands for basic or static model? and kink slope is simple slope of the model?
                          4. What is the role of Number of moment conditions it should be less than "N" or can be more than "N".

                          Thanks in advance. If you can provide your email or social media contact for faster communication it will be highly appreciated.

                          Is anyone get the answer to this? How to interpret the xthenreg result?
                          Muhammad Bilal Ahsin
                          zaki tchy
                          sedki zn
                          River Huang
                          Suresh Paul
                          fai ot


                          Regards,
                          Zarifah

                          Comment

                          Working...
                          X