.- help for ^sqreg^ (STB-38: sg70) .- Simultaneous quantile regression -------------------------------- ^sqreg^ [depvar [varlist] [^if^ exp] [^in^ range] ] [^, q^uantiles^(^# [# [# ...]]^) r^eps^(^#^) nolo^g ^l^evel^(^#^)^ ] This command shares the features of all estimation commands, see help @est@. To reset problem-size limits, see help @matsize@. Due to how ^sqreg^ is implemented, no more than 336 coefficients may be simultaneously estimated regardless of the value of ^matsize^. This means no more than 336/Q variables, where Q is the number of ^quantiles()^ specified. For instance, if 2 quantiles are specified, no more than 168 independent variables may be specified; if 3 quantiles are specified, no more than 112 independent variables may be specified; and so on. Description ----------- ^sqreg^ estimates quantile regressions. It produces the same coefficients as ^qreg^ would produce were each quantile estimated separately. Reported standard errors will be similar, the difference being that that ^sqreg^ obtains standard errors via bootstrapping rather than analytical formula. (In this sense, sqreg is similar to @bsqreg@, the bootstrapped variation of ^qreg^.) ^sqreg^ differs from ^qreg^ (and ^bsqreg^) in that it estimates results for multiple quantiles simultaneously, meaning that the calculated variance-covariance matrix of the estimators (VCE) includes blocks for between-quantiles. Thus, one can test and construct confidence intervals comparing coefficients describing different quantiles. Options ------- ^quantiles(^# [# [# ...]]^)^ specifies the quantiles to be estimated. For instance, ^quantiles(.25 .75)^ specifies that two equations are to be estimated, one for the .25 quantile and another for the .75. ^quantiles(.25 .50 .75)^ specifies three equations; a .50 quantile (median) regression is to be added. Strictly speaking, numbers should be between 0 and 1, exclusive. However, if you specify a number larger than 1, it will be iterpreted as a percent. Thus, ^quantiles(.25 .50 .75)^ could also be specified as ^quantiles(25 50 75)^ or even ^quantiles(25 .5 75)^ if you wish. You may optionally place a comma between the two numbers. You may type ^quantiles(25 50 75)^ or ^quantiles(25,50,75)^. Quantiles may be specified in any order. Results will be more easily read, however, if you specify them in ascending order. ^reps(^#^)^ specifies the number of bootstrap replications to be used to obtain an estimate of the variance-covariance matrix of the estimators (standard errors). ^reps(20)^ is the default. This default is arguably too small. ^reps(100)^ would perform 100 bootstrap replications. ^reps(1000)^ would perform 1,000. ^nolog^ specifies itermediate output during the estimation process is not to be presented. If ^nolog^ is not specified, a period is placed on the screen after the completion of each replication (so if ^reps(100)^ is specified, 100 periods appear before final results are presented). ^nolog^ suppresses this. ^level(^#^)^ specifies the confidence level in percent for the confidence interval of the coefficients; see help @level@. Remarks ------- If you are not familiar with quantile regression, please see help @qreg@. Consider a quantile-regression model where the q-th quantile is given by Q_q(y) = a_q + b1_q*var1 + b2_q*var2 For instance, the 25th and 75th quantiles are given by Q25(y) = a_25 + b1_25*var1 + b2_25*var2 Q75(y) = a_75 + b1_75*var1 + b2_75*var2 and you could estimate these two equations by using the existing @qreg@ command: . ^qreg y var1 var2, q(.25)^ . ^qreg y var1 var2, q(.75)^ Alternatively, you could type . ^sqreg y var1 var2, q(.25 .75)^ The advantage of sqreg is that you can then test hypotheses between equations. For instance, you could test whether. For instance, you could test that b1_75 = b1_25 by typing . ^test [q25]var1 = [q75]var1^ after ^sqreg^ whereas you could not do that after ^qreg^ because only equation at a time is estimated and there is no estimate of covariance between equations; see help @test@. Similarly, you could obtain a confidence interval for (b1_75-b1_25) by typing . ^lincom [q75]var1 - [q25]var1^ See help @lincom@. You could obtain a simultaneous test that both b1_25=0 and b1_75=0 by typing . ^test [q25]var1 [q75]var1^ Example ------- Say you are interested in a model of ln_wage on edyrs, exp, and exp_sq estimated on CPS data. You estimate . ^qreg ln_wage edyrs exp exp_sq, quantile(.90)^ and obtain a coefficient on edyrs of .11261. You estimate . ^qreg ln_wage edyrs exp exp_sq, quantile(.10)^ and obtain a coefficient on edyrs of .16218. Thus, it appears that the effect of schooling is more pronounced at the 1st as compared to the 9th decile of earnings. Estimating the equations separately, you have no statistical way to measure whether the estimated effects (.16218 and .11261.) really differ. With ^sqreg^, you can estimate the model and form the test: . ^sqreg ln_wage edyrs exp exp_sq, q(10 90)^ . ^test [q10]edyrs = [q90]edyrs^ (Also see help @iqreg@ for another, equivalent solution to this problem.) ^sqreg^ obtains variance estimates by bootstrapping. In this case, when no ^reps()^ option was specified, 20 samples were drawn and two quantile regressions were estimated on each sample. Twenty is a small number of bootstrap replications; the default was chosen so that ^sqreg^ would produce some kind of result in a reasonable amount of time. If you wanted 100 bootstrap replications, you would type . ^sqreg ln_wage edyrs exp exp_sq, q(10 90) reps(100)^ The number of replications does not affect estimated coefficients; it does affect reported standard errors. ^sqreg^'s results are determined by the random number seed; see help @seed@. If you set the random number seed, estimate a model with some number of replications, reset the seed to be the same number again and repeat the estimation with the same number of replications, you will obtain the same results in the second run as the first. Examples -------- . ^sqreg mpg foreign, q(.25 .75)^ . ^sqreg ln_wage edyrs exp exp_sq, reps(100) q(.2 .5 .75)^ . ^sqreg ln_wage edyrs exp exp_sq, reps(100) q(10 25 50 75 90)^ Author ------ William Gould StataCorp email: tech_support@@stata.com Also see -------- STB: sg70 (STB-38) On-line: help for @qreg@, @iqreg@; @lincom@, @test@, @est@, @matsize@