Hi all,

Recently I read a paper published in JAMA Pediatrics(doi:10.1001/jamapediatrics.2019.1212), the authors provide the P value of the mediating variables using the -khb- command in Stata (Table 2, listed below). Array



I want to estimate the the P value in Summary of confounding part(Conf_Pct column) and Components of Difference part(P_Reduced column), as illustrated in Table 2, but didnot know how.

The -khb- is user-written program and can be installed by command:

HTML Code:
. net sj 13-1 st0236_2
. net install st0236_2   // INSTALLATION FILES 
. net get st0236_2       // ANCILLARY FILES, including dlsy_khb.dta and khb.do
​​​​​​​Below is my codes and results, can anyone offer any clue?

HTML Code:
. use dlsy_khb.dta

. khb logit univ fses || abil intact boy, disentangle summary verbose

(omitted)

Logistic regression                             Number of obs     =      1,896
                                                LR chi2(4)        =     216.87
                                                Prob > chi2       =     0.0000
Log likelihood = -468.31516                     Pseudo R2         =     0.1880

------------------------------------------------------------------------------
        univ |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        fses |   .3817324   .0778061     4.91   0.000     .2292353    .5342295
        abil |   1.065516    .106775     9.98   0.000     .8562405    1.274791
      intact |    1.08391   .7386558     1.47   0.142    -.3638292    2.531648
         boy |   .9821406   .1848351     5.31   0.000     .6198704    1.344411
       _cons |  -4.462997   .7479123    -5.97   0.000    -5.928878   -2.997116
------------------------------------------------------------------------------

(omitted)

Logistic regression                             Number of obs     =      1,896
                                                LR chi2(4)        =     216.87
                                                Prob > chi2       =     0.0000
Log likelihood = -468.31516                     Pseudo R2         =     0.1880

------------------------------------------------------------------------------
        univ |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        fses |   .5805281   .0786111     7.38   0.000     .4264531    .7346031
    __000001 |   1.065516    .106775     9.98   0.000     .8562405    1.274791
    __000002 |    1.08391   .7386558     1.47   0.142    -.3638292    2.531648
    __000003 |   .9821406   .1848351     5.31   0.000     .6198704    1.344411
       _cons |  -2.945969    .124697   -23.63   0.000    -3.190371   -2.701568
------------------------------------------------------------------------------

Decomposition using the KHB-Method

Model-Type:  logit                                 Number of obs     =    1896
Variables of Interest: fses                        Pseudo R2         =    0.19
Z-variable(s): abil intact boy
------------------------------------------------------------------------------
        univ |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
fses         |
     Reduced |   .5805281   .0786111     7.38   0.000     .4264531    .7346031
        Full |   .3817324   .0778061     4.91   0.000     .2292353    .5342295
        Diff |   .1987956   .0359394     5.53   0.000     .1283557    .2692355
------------------------------------------------------------------------------

Summary of confounding

        Variable | Conf_ratio    Conf_Pct   Resc_Fact  
    -------------+-------------------------------------
            fses |  1.5207722       34.24   1.1317064  
    ---------------------------------------------------

Components of Difference

      Z-Variable |      Coef    Std_Err     P_Diff  P_Reduced  
    -------------+---------------------------------------------
    fses         |                                            
            abil |  .1661177   .0301003      83.56      28.61  
          intact |   .020142   .0144611      10.13       3.47  
             boy |  .0125359    .011524       6.31       2.16  
    -----------------------------------------------------------
Thank you all in advance!

The user-written program -khb-, created by Ulrich Kohler, Kristian Bernt Karlson, and Anders Holm, and detailed in the following article:
Kohler, U., K.B. Karlson, and A. Holm. 2011. "Comparing Coefficients of Nested Nonlinear Probability Models." Stata Journal, 11(3): 420-38.
https://journals.sagepub.com/doi/pdf...867X1101100306