*! version 1.0 20July2020

*! version 2.0 12December2023
help kurtosisreg

Title

kurtosisreg -- Kurtosis Regression

Syntax

kurtosisreg depvar [indepvars] [if] [in]
[, options]

Model
reps(#) specify number of bootstrap replications; default is reps(50)

seed(#) set random seed; default is seed(1)

Reporting
detail show detailed results

graph graph coefficients and confidence intervals

level(#) set confidence level; default is level(95)

predict(string) predict conditional kurtosis

by and bysort are allowed; see prefix.

Description

kurtosisreg performs kurtosis regression for cross-sectional or time-series data as defined in Chen and Xiao (2020), which quantifies the effects of covariates on quantile-based measure of kurtosis of the conditional distribution.
kurtosisreg calls qrprocess for fast implementation of quantile regressions (Chernozhukov et al., 2020, 2022), which also avoids the potential problem of quantile crossing (Chernozhukov et al., 2010).
The command qrprocess can be installed from SSC by typing "ssc install qrprocess,replace".
kurtosisreg then use margins to computes average marginal effects (AME), which are parameters of interest.
For a continuous variable x, AME is defined as marginal effects (dy/dx) averaged over all observations. For discrete variables, marginal effects are defined as discrete changes from the base level.
For example, for a dummy variable x, AME is defined as (y|x=1)-(y|x=0), averaged over all observations. Standard errors for AMEs are obtained by the delta method from bootstrap standard errors.

Options

Model

reps specify the number of bootstrap replications used for obtaining bootstrap standard errors. The default is reps(50) for fast computation, but reps(500) is recommended for accurate results.

seed set random seed for reproducible results. The default is seed(1).

Reporting

detail show detailed results, including simultaneous quantile regression, the numerator and denominator parts of kurtosis regression.

graph graph coefficients of kurtosis regression to visualize average marginal effects and their confidence intervals.

level(#) set confidence level for confidence intervals in both regression results and graph. The default is level(95) for the 95% confidence level.

predict(string) predict conditional kurtosis for possible later usage.

Example: fast but trivial

Setup

. sysuse auto,clear

Fit a default kurtosis regression

. kurtosisreg price mpg weight foreign

Fit a kurtosis regression with detailed output, 90% confidience intervals, coefficient graph, and record predicted conditional kurtosis as a new variable kurtosis

. kurtosisreg price mpg weight foreign, detail level(90) graph predict(kurtosis)

Fit a kurtosis regression with random seed 123 and 500 bootstrap replications

. kurtosisreg price mpg weight foreign, seed(123) reps(500)

Fit a kurtosis regression in a subsample

. kurtosisreg price mpg weight foreign if rep78==3

Example: slow but interesting

Setup (1% US census data in 1980 obtained from Angrist et al.(2006). After loading data, use command notes for a detailed description)

. sysuse census80.dta, clear

Fit a default kurtosis regression (for correct computation of AME, use factor variable (see fvvarlist) c.exper#c.exper so that Stata recognizes it as the square of exper)

. kurtosisreg logwk educ black exper c.exper#c.exper

Test joint significance of coefficients following the above kurtosis regression

. test educ black exper

Fit a kurtosis regression with detailed output, 90% confidience intervals, coefficient graph, and record predicted conditional kurtosis as a new variable kurtosis

. kurtosisreg logwk educ black exper c.exper#c.exper, detail level(90) graph predict(kurtosis)

Fit a kurtosis regression with random seed 123 and 500 bootstrap replications

. kurtosisreg logwk educ black exper c.exper#c.exper, seed(123) reps(500)

Fit a default kurtosis regression for the black and non-black subsamples respectively via bysort

. bysort black: kurtosisreg logwk educ exper c.exper#c.exper

Example: time series

Setup

. sysuse sp500.dta, clear

Since qrprocess doesn't accept time-series operators (see tsvarlist), kurtosisreg doesn't either. So define one-period lagged variable manually

. gen trade_date = _n

. tsset trade_date

. gen l1_close = l.close

Fit a default kurtosis regression

. kurtosisreg close l1_close

Fit a kurtosis regression with detailed output, 90% confidience intervals, coefficient graph, and record predicted conditional kurtosis as a new variable kurtosis

. kurtosisreg close l1_close, detail level(90) graph predict(kurtosis)

Fit a kurtosis regression with random seed 123 and 500 bootstrap replications

. kurtosisreg close l1_close, seed(123) reps(500)

Stored results

kurtosisreg stores the following in e():

Scalars

e(N) number of observations

e(df_r) residual degrees of freedom

e(reps) number of bootstrap replications

e(seed) random seed number

e(q1) quantile index of the first quantile regression

e(q2) quantile index of the second quantile regression

e(q3) quantile index of the third quantile regression

e(q4) quantile index of the fourth quantile regression

e(q5) quantile index of the fifth quantile regression

e(q6) quantile index of the sixth quantile regression

e(pr_q1) pseudo R2 of the first quantile regression

e(pr_q2) pseudo R2 of the second quantile regression

e(pr_q3) pseudo R2 of the third quantile regression

e(pr_q4) pseudo R2 of the fourth quantile regression

e(pr_q5) pseudo R2 of the fifth quantile regression

e(pr_q6) pseudo R2 of the sixth quantile regression

Macros

e(vcetype) Delta-method

e(cmdline) command as typed

e(cmd) kurtosisreg

e(properties) b V

e(depvar) Kurtosis

Matrices

e(b) coefficient vector, i.e. average marginal effects

e(V) variance-covariance matrix of the estimators

Functions

e(sample) marks estimation sample

Author

Qiang Chen, School of Economics, Shandong University, P. R. China

qiang2chen2@126.com
www.econometrics-stata.com

References

Angrist, Joshua, Victor Chernozhukov and Iván Fernández-Val, 2006. Quantile Regression under Misspecification, with an Application to the U.S. Wage Structure.
Econometrica, 74(2), 539-563.

Chernozhukov, Victor, Iván Fernández-Val and Alfred Galichon, 2010. Quantile and Probability Curves without Crossing.
Econometrica, 78, 1093-1125.

Chernozhukov, Victor, Iván Fernández-Val and Blaise Melly, 2020. Quantile and Distribution Regression in Stata: Algorithms, Pointwise and
Functional Inference. Working paper.

Chernozhukov, Victor, Iván Fernández-Val and Blaise Melly, 2022. Fast Algorithms for the Quantile Regression Process.
Empirical Economics, 62,7-33.

Chen, Qiang, and Zhijie Xiao, 2023, "Spread Regression, Skewness Regression and Kurtosis Regression with an Application to the U.S. Wage Structure," Journal of Applied Econometrics, revise and resubmit.