Function

KHB can be used for several different types of non-linear regression models. This include logistic (logit), ordinal (ologit), and multinominal (mlogit) – but not Poisson or Cox). What it does is that it compares the effect of x on y in a model without any covariates (“reduced model”) with a model with on or more covariates (“full model”).    

The method is not part of standard Stata, so unless you already have done so, install the KHB package: 

ssc install khb

Basic command
khb modeltype yvar xvar || zvar(s) 
Useful options
khb modeltype yvar xvar || zvar(s), disentangle 
khb modeltype yvar xvar || zvar(s), summary 
khb modeltype yvar xvar || zvar(s), or 
Explanations
yvarInsert the name of the y-variable that you want to use.
xvarInsert the name of the x-variable that you want to use.
zvar(s)Insert the name of the mediator as well as any confounder(s) that you want to include. 
modeltypeSpecify what kind of regression model you want to perform (e.g. logit, ologit, or mlogit).
disentangleDisentangle the contribution of each z-variable.
summarySummary of decomposition.
orDisplay odds ratios. 
More information
help khb