Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | xueliansharon <xuelianstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: quantile regression with IV |
Date | Thu, 1 Jul 2010 16:02:01 -0700 (PDT) |
Dear all, I want to do quantile regression, but I have an endogenous variable, so I regress the endogenous variable price on IVs in the first stage and get the predicted value for price, then do quantile regression of mpg on foreign and pricehat, then I bootstrap the whole program to correct for the standard errors of the second stage. My problem is that the following codes just return the estimates for 0.9 quantile regression, but what I want are the quantile regressions for quantiles 0.1,0.2,...,0.9 with endogenous variable instrumented and standard errors corrected. So could anyone help me to point out my mistakes and provide the correct codes to me? Many thanks. The following are my codes: sysuse auto, clear program qregivb version 11.1 // Stage 1 regress price foreign weight length predict pricehat, xb // Stage 2 foreach quant of numlist 0.1 0.2 0.25 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.9 { qreg mpg foreign pricehat, quantile (`quant') } end bootstrap qregivb _b, reps(100) Best, Sharon -- View this message in context: http://statalist.1588530.n2.nabble.com/quantile-regression-with-IV-tp5245688p5245688.html Sent from the Statalist mailing list archive at Nabble.com. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/