Dear fellow Stata enthusiasts –
With thanks to Kit Baum, and on behalf of David Powell and Travis Smith, I am happy to announce two new Stata Packages: genqreg and qregpd. These packages implement the generalized quantile estimator developed by Powell (2016), and the panel quantile estimator developed by Powell (2015). A detailed description of each estimator follows.
genqreg – generalized quantile regression in Stata:
genqreg implements the generalized quantile estimator developed in Powell (2016). The generalized quantile estimator addresses a fundamental problem posed by traditional quantile estimators: inclusion of additional covariates alters the interpretation of the estimated coefficient on the treatment variable. The generalized quantile estimator implemented by genqreg addresses this problem and produces unconditional quantile treatment effects even in the presence of additional control variables. genqreg also allows for endogeneity and inclusion of additional instruments, and inclusion of additional “proneness” variables.
As estimation can be numerically challenging, and recovering standard errors difficult, genqreg provides a number of alternative estimation methods. One can estimate via grid search, Markov chain Monte Carlo (MCMC), or Nelder-Mead numerical optimization. To use MCMC, the user must first install the AMCMC package (ssc install amcmc) .
Examples, following Chernozhukov and Hansen (2008):
Robust quantile regression with qreg:
Same as above, with genqreg:
Same, estimation via MCMC:
Specifying control variables as proness variables, with an instrument, estimation using grid-search:
Additional examples can be found in the genqreg help file. genqreg can be installed via ssc (ssc install genqreg)
qregpd – quantile regression with panel data in Stata
qregpd implements the quantile estimator for panel data developed by Powell (2015). As detailed in Powell (2016) – an awesome paper - this estimator is a special case of the generalized quantile estimator implemented by genqreg. The estimator addresses a fundamental problem posed by alternative fixed-effect quantile estimators: inclusion of fixed effects alters the interpretation of the estimated coefficient on the treatment variable.
As is the case for genqreg, estimation of parameters and standard errors can be difficult, so a variety of different options, including MCMC estimation and grid search, are provided with qregpd.
Examples:
Robust quantile regression for panel data:
Same as above, MCMC:
Robust instrumental variable quantile regression for panel data, grid-search optimization:
Further examples and options can be found in the help file. qregpd can be install via ssc (ssc install qregpd).
Enjoy! And of course, comments, criticisms, and suggestions are welcome...
Matt Baker (on behalf of David Powell and Travis Smith)
With thanks to Kit Baum, and on behalf of David Powell and Travis Smith, I am happy to announce two new Stata Packages: genqreg and qregpd. These packages implement the generalized quantile estimator developed by Powell (2016), and the panel quantile estimator developed by Powell (2015). A detailed description of each estimator follows.
genqreg – generalized quantile regression in Stata:
genqreg implements the generalized quantile estimator developed in Powell (2016). The generalized quantile estimator addresses a fundamental problem posed by traditional quantile estimators: inclusion of additional covariates alters the interpretation of the estimated coefficient on the treatment variable. The generalized quantile estimator implemented by genqreg addresses this problem and produces unconditional quantile treatment effects even in the presence of additional control variables. genqreg also allows for endogeneity and inclusion of additional instruments, and inclusion of additional “proneness” variables.
As estimation can be numerically challenging, and recovering standard errors difficult, genqreg provides a number of alternative estimation methods. One can estimate via grid search, Markov chain Monte Carlo (MCMC), or Nelder-Mead numerical optimization. To use MCMC, the user must first install the AMCMC package (ssc install amcmc) .
Examples, following Chernozhukov and Hansen (2008):
Robust quantile regression with qreg:
Code:
. use http://fmwww.bc.edu/repec/bocode/j/jtpa.dta, clear . keep if sex == 1 . qreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85) vce(robust)
Code:
. genqreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85)
Code:
. genqreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, /// q(85) optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)
Code:
genqreg earnings training, q(85) instrument(assignmt) proneness(hsorged black hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms) /// optimize(grid) min1(1000) max1(3500) intvl1(50)
qregpd – quantile regression with panel data in Stata
qregpd implements the quantile estimator for panel data developed by Powell (2015). As detailed in Powell (2016) – an awesome paper - this estimator is a special case of the generalized quantile estimator implemented by genqreg. The estimator addresses a fundamental problem posed by alternative fixed-effect quantile estimators: inclusion of fixed effects alters the interpretation of the estimated coefficient on the treatment variable.
As is the case for genqreg, estimation of parameters and standard errors can be difficult, so a variety of different options, including MCMC estimation and grid search, are provided with qregpd.
Examples:
Robust quantile regression for panel data:
Code:
. webuse nlswork . qregpd ln_wage tenure union, id(idcode) fix(year)
Code:
. qregpd ln_wage tenure union, id(idcode) fix(year) optimize(mcmc) noisy draws(1000) burn(100) arate(.5)
Code:
. qregpd ln_wage tenure union, id(idcode) fix(year) optimize(grid) min1(0) max1(0.06) intvl1(0.005) min2(0.05) max2(0.1) intvl2(0.005) instruments(ttl_exp wks_work union)
Enjoy! And of course, comments, criticisms, and suggestions are welcome...
Matt Baker (on behalf of David Powell and Travis Smith)
Comment