* This example file shows how you can set starting values * for what observations get dropped. clear infile y x z using smpldata.raw local depvar y /* Dependent Variable */ local expvar x z /* Explanatory Variables */ local quint 0.35 /* Quantile of Interest */ *qcenreg `depvar' `expvar', quantile(`quint') qreg `depvar' `expvar', quantile(0.45) predict predval egen lowval = min(`depvar') qcenreg `depvar' `expvar' if predval > lowval, quantile(`quint') qcrstep `depvar' `expvar', quantile(`quint') qstart(0.45) qstep(0.02) * to get bootstrapped standard errors local nreps 100 /* Number of replications */ local dname "bsest" /* Name of the dataset to store estimates */ local niters 40 /* Max number of iterations to try to improve the quantile estimate*/ bs " qcenreg `depvar' `expvar', quantile(`quint') maxiter(`niters')" "_b[x] _b[z] _b[_cons]", reps(`nreps') saving(`dname') replace dots bs " qcrstep `depvar' `expvar', quantile(`quint') qstart(0.45) qstep(0.02) maxiter(`niters')" "_b[x] _b[z] _b[_cons]", reps(`nreps') saving(`dname') replace dots * reps controls how many replications to do * saving where to put the estimates (optional but I think useful) * replace says to replace the dataset if it already exists. * dots puts a dot on the screen for each replication