Stata Command: itvalpctile

Stata Command: itvalpctile.ado

Estimation of interval-valued percentiles (quantiles) for interval-valued data based on Beresteanu and Sasaki (2021). Use it when you have interval-valued data as is often the case with survey and questionnaire responses and want to estimate its interval-valued percentiles (quantiles) together with their confidence sets.

Installation:

. ssc install itvalpctile

Usage:

. use "CHTdata_extract10percent.dta"

. itvalpctile lower upper

. itvalpctile lower upper, pl(25) ph(75) np(11)

. itvalpctile lower upper, conditional(v2) location(0.05)

. itvalpctile lower upper if v1 == 40

Help:

. help itvalpctile

Reference: Beresteanu, A. and Y. Sasaki (2021) Quantile Regression with Interval Data. Econometric Reviews (Special Issue Honoring Cheng Hsiao), 40 (6): 562-583. Paper

Title
itvalpctile -- Executes estimation of interval-valued percentiles (quantiles) for interval-valued data.
Syntax
itvalpctile lower upper [if] [in] [, cover(real) pl(real) ph(real) np(real) conditional(varname) location(real)]
Description
itvalpctile executes estimation of percentiles (quantiles) for interval-valued data based on Beresteanu and Sasaki (2020). It applies to interval-valued survey and questionnaire responses. The command takes the lower bound (lower) and the upper bound (upper) of the intervals. It returns interval-valued percentiles (and their valid confidence sets if lower and upper are continuous). The command can also compute conditional interval-valued percentiles and their confidence sets by calling the option conditional.
Options
cover(real) sets the nominal probability that the confidence sets cover the true percentiles. The default value is cover(.95).
pl(real) sets the lowest percent at which the interval-valued percentile is reported. The default value is pl(10).
ph(real) sets the highest percent at which the interval-valued percentile is reported. The default value is ph(90).
np(real) sets the number of percent points at which the interval-valued percentile is reported. The default value is np(9).
conditional(varname) sets a conditioning variables with which the conditional interval-valued percentiles are estimated. Not calling this option tells the command to estimate the unconditional interval-valued percentiles.
location(real) sets the location of the conditioning variable at which the conditional interval-valued percentiles are estimated. Not calling this option results in using the mean value of the conditioning variable as the location.
Examples
. use "CHTdata_extract10percent.dta"
(lower lower bound, upper upper bound, v1 discrete conditioning variable, v2 continuous conditioning variable)
Estimation of interval-valued percentiles at the percent points 10, 20, 30, 40, 50, 60, 70, 80 and 90:
. itvalpctile lower upper
Estimation of interval-valued percentiles at the percent points 25, 30, 35, 40, 45, 50, 55, 60, 65, 70 and 75:
. itvalpctile lower upper, pl(25) ph(75) np(11)
Estimation of interval-valued percentiles with 90% confidence sets:
. itvalpctile lower upper, cover(0.90)
Estimation of conditional interval-valued percentiles given v2=0.05 for a "continuous" variable v2:
. itvalpctile lower upper, conditional(v2) location(0.05)
Estimation of conditional interval-valued percentiles given v1=40 for a "discrete" variable v1:
. itvalpctile lower upper if v1 == 40
Stored results
itvalpctile stores the following in r():
Scalars r(N) observations
Macros r(cmd) itvalpctile
Matrices r(percent) vector of percents r(lower) vector lower bounds r(upper) vector upper bounds r(CSlower) vector lower bounds of confidence set r(CSupper) vector upper bounds of confidence set
Reference
Beresteanu, A. and Y. Sasaki. 2021. Quantile Regression with Interval Data. Econometric Reviews (Special Issue Honoring Cheng Hsiao), 40 (6): 562-583. Link to Paper.
Authors
Arie Beresteanu, University of Pittsburgh, Pittsburgh, PA. Yuya Sasaki, Vanderbilt University, Nashville, TN.