Stata Command: exquantile

Stata Command: exquantile.ado

Estimation and inference for (conditional) extremal quantiles based on the nearest neighbor method for the Hill's estimator of the tail index in the increasing-k framework, cf. Appendix A.5 of Sasaki and Wang (2021) (The fixed-k framework does not provide an estimate or a standard error, and hence it is not implemented in the current Stata command. Interested researchers can find a MATLAB code here for constructing fixed-k confidence intervals.) Use it when you want to compute (conditional) extremal quantiles, such as the (conditional) 0.1-th percentile or the (conditional) 99.9-th percentile, which cannot be estimated well by the standard quantile methods. For instance, the following Stata output displays show the 1st (top) and 0.1th (bottom) conditional quantiles of the birth weight in grams for smoking mothers at age 40. 

Installation:    

    . ssc install exquantile

Usage:

    . use "natl_random.dta"

    . xtset id time

    . exquantile birwt age if !nosmoke, q(0.01) xval(40)

Help:    

    . help exquantile

Reference:  Sasaki, Y & Y. Wang (2022) Fixed-k Inference for Conditional Extremal Quantiles. Journal of Business & Economic Statistics , 40 (2), pp. 829-837. Paper.

Title
    exquantile -- Executes estimation and inference for (conditional)        extremal quantiles.
Syntax
    exquantile depvar [indepvar] [if] [in] [, q(real) k(real) xval(real)]
Description
    exquantile estimates (conditional) extremal quantiles based on the        nearest neighbor method for the Hill's estimator of the tail index        in the increasing-k framework, cf. Appendix A.5 of Sasaki and Wang        (2021) (The fixed-k framework does not provide an estimate or a        standard error, and hence it is not implemented in the current Stata        command.  Interested researchers can find a MATLAB code here for        constructing fixed-k confidence intervals.) If indepvar is absent in        the command line, then the unconditional extremal quantile is        computed.  If indepvar is present in the command line, then the        conditional extremal quantile is computed given the value of        indepvar specified by the xval option.  To compute conditional        extremal quantiles given a continuous indepvar, the data have to be        either panel or repeated cross sectional data.  For unconditional        extremal quantiles (or conditional extremal quantiles given a        discrete variable), on the other hand, data can be cross sectional        or repeated cross sectional.
Options

    q(real) sets the quantile value. As an extremal quantile, it is natural        to be set either below 0.05 or above 0.95. (A warning message shows        up if q is set betwen 0.05 and 0.95.) The default value is q(0.99).
    k(real) sets the number of tail observations to be used. If this option        is not called, then k is automatically set to be an integer that is        smaller than 5% of the sample size by default.
    xval(real) sets the value of indepvar x at which the conditional        extremal quantile is estimated. If indepvar is included and this        option is not called, then xval is automatically set to the sample        average of indepvar by default.
Examples
    Estimation of the 0.1-th percentile of the infant birthweight:
    . use "natl_random.dta"    . exquantile birwt, q(0.001)
    Estimation of the first percentile of the infant birthweight for        non-smoking and smoking mothers:
    . use "natl_random.dta"    . exquantile birwt if nosmoke, q(0.01)    . exquantile birwt if !nosmoke, q(0.01)
    Estimation of the first percentile of the infant birthweight for        non-smoking and smoking mothers of age 40:
    . use "natl_random.dta"    . xtset id time    . exquantile birwt age if nosmoke, q(0.01) xval(40)    . exquantile birwt age if !nosmoke, q(0.01) xval(40)
    Note that conditioning on a continuous variable requires to use either        panel or repeated cross sectional data. The panel or repeated cross        sectional structure can be first set by the xtset command before        running exquantile.
Stored results
    exquantile stores the following in e():
    Scalars        e(N)           observations        e(q)           quantile value        e(k)           tail observations
    Macros        e(cmd)         exquantile        e(properties)  b V
    Matrices        e(b)           coefficient vector        e(V)           variance-covariance matrix of the estimators
    Functions        e(sample)      marks estimation sample
Reference
    Sasaki, Y. and Y. Wang 2022. Fixed-k Inference for Conditional Extremal        Quantiles. Journal of Business & Economic Statistics, 40 (2): 829-837.        Link to Paper.
Authors
    Yuya Sasaki, Vanderbilt University, Nashville, TN.    Yulong Wang, Syracuse University, Syracuse, NY.