Dear Statalisters:
I have contributed this module to SSC (thanks to Kit Baum):
cdfquantreg01: Stata module for estimating generalized linear models for doubly-bounded random variables with finite-tailed cdf-quantile distributions.

cdfquantreg01 estimates generalized linear models with finite-tailed cdf-quantile (FTCDFQ) distributions for doubly-bounded random variables (Smithson & Shou, 2022). It assumes that the dependent variable's values are in the [0,1] interval, i.e., it has defined densities at 0 and 1 so it can handle zeros and ones in the data. These two- and three-parameter distributions are especially useful for modeling quantiles, and have very flexible shapes. They enable a wide variety of quantile regression models with predictors for the location and dispersion parameters, and simple interpretations of those parameters. Users may specify separate submodels for the location, skew, and dispersion parameters, with different or overlapping sets of predictors in each. This module has similar capabilities to its counterpart package in R (Shou & Smithson, 2019, with the package updated to include these new distributions).

Code:
ssc install cdfquantreg01

A demonstration data-set is from a study by Yoon, Steiner, and Reinhardt (2003) of time spent by patients admitted to the emergency department of the University of Alberta Hospital between midnight January 23 and midnight January 29, 1999, for five stages of ED assessment and treatment: Registration, triage assessment, nursing assessment, physician assessment, and disposition decision.
Our example focuses on the proportion of time spent in the registration-triage stage. Patients arriving by ambulance tended to have more life-threatening conditions than those arriving as ``walk-ins'', so we expect to find that the ambulance-arrivals spend a smaller proportion of their time in this preliminary and mainly bureaucratic stage because serious cases need to be rushed into treatment. The more serious cases also typically required lengthy nursing and treatment times, so expect that longer length of stay will predict a lower proportion of time spent in the Registration-triage stage.

From the family of FTCDFQ distributions we use a two-parameter Cauchit-ArcSinh outer-W distribution for this demonstration. A model using this distribution identifies significant effects of both ambulance arrival and log of length-of-stay in the expected directions for the skew parameter q submodel (eq1). Note that the coefficients are positive for Ambulance and loglosh, because q tracks skew and therefore a positive coefficient predicts a decrease in the median proportion of time spent in the registration-triage stage.
Code:
. cdfquantreg01 pregptriage i.ambulance loglosh , cdf(cauchit) quantile(asinh) pos(outer) func(w) twothree(2) zvarlist(i.ambulance loglosh)

Number of obs = 894
Wald chi2(2) = 35.08
Log likelihood = 935.82938 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
pregptriage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1 |
1.ambulance | 1.44701 .4390561 3.30 0.001 .5864763 2.307544
loglosh | .602078 .1306889 4.61 0.000 .3459325 .8582236
_cons | 1.362088 .1370775 9.94 0.000 1.093421 1.630755
-------------+----------------------------------------------------------------
eq2 |
1.ambulance | -.1100352 .4265914 -0.26 0.796 -.946139 .7260686
loglosh | .2427018 .1257848 1.93 0.054 -.0038319 .4892356
_cons | -.4175588 .1285837 -3.25 0.001 -.6695782 -.1655394
------------------------------------------------------------------------------
. estimates store A


There is a marginally non-significant effect of loglosh in the s (dispersion parameter) submodel (eq2). Nonetheless, it turns out that a model without the dispersion submodel effects suffers a significant decline in goodness-of-fit. However, a model with interaction-effect terms does not significantly improve fit over the main-effects model (neither of these runs are shown here, but the reader may readily verify these claims by running the additional models). So our final model is one that includes main-effects terms for loglosh and ambulance in both submodels.

The margins command operates as usual in Stata, but the cdfquantreg01_mf program adds functionality by producing marginal predictions of quantiles across categories of categorical predictors. The example below shows this being done for the predicted median by setting the pctle option to 0.5. The predicted marginal median proportions of time spent in the registration-triage state are displayed in the last two lines of output in the table below. For walk-ins the median is 0.125 whereas for ambulance-arrivals it is only 0.036.

. cdfquantreg01_mf ambulance, pctle(0.5)
Predictive margins Number of obs = 894
Model VCE : OIM

Expression : Linear prediction, predict(equation(#1))
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ambulance |
0 | 2.074836 .1242395 16.70 0.000 1.831331 2.318341
1 | 3.521847 .4271211 8.25 0.000 2.684705 4.358988
------------------------------------------------------------------------------
(results modresults are active now)

Predictive margins Number of obs = 894
Model VCE : OIM

Expression : Linear prediction, predict(equation(#2))
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ambulance |
0 | -.1302452 .1193036 -1.09 0.275 -.364076 .1035856
1 | -.2402805 .4157706 -0.58 0.563 -1.055176 .5746149
------------------------------------------------------------------------------
(results modresults are active now)

ambulance
.5 quantile factor level
--------------------------
.12464288 0bn.ambulance
.03619026 1.ambulance


The following help files are included in this module:
cdfquantreg01.sthlp, cdfquantreg01_postestimation.sthlp, cdfquantreg01_margins.sthlp

I welcome comments and suggestions, and an appropriate citation would be greatly appreciated if you end up using this module in your own research.

References:
Shou, Y. & Smithson, M. (2019). cdfquantreg: An R package for cdf-quantile regression. Journal of Statistical Software, 88, 1-30.
Smithson, M. & Shou, Y. (accepted 18/11/22). Flexible cdf-quantile distributions on the closed unit interval, with software and applications. Communications in Statistics – Theory and Methods.
Yoon, P., Steiner, I. & Reinhardt, G. (2003). Analysis of factors influencing length of stay in the emergency department. Canadian Journal of Emergency Medicine, 5, 155–161.