# problem with grqreg after qreg

5 messages
Open this post in threaded view
|
Report Content as Inappropriate

## problem with grqreg after qreg

 Hi all, In the following code, when I run grqreg after qreg, why do I get a curve instead of a point in this graph (say graph 1)? grqreg should plot the coefficient before weight for 0.5 quantile regression in my codes, which should be a point 3.933588 in the graph, so why does grqreg retrun a curve? The following are my codes: webuse auto, clear qreg price weight length turn foreign, quantile(0.5) grqreg weight, ci ols olsci Also, I check the coefficients of weight when running qreg for quantile 0.1, 0.2,0.3,...,0.9 respectively, and it seems like the coefficients before weight for each quantile regression are the same to the value in the graph1 (graph 1 is gotten by running grqreg after 0.5 quantile regression), that is, the coefficient before weight for 0.1 quantile regression is the same to the value in graph 1 for quantile 0.1,  is this correct? Then does it mean that grqreg will yield the same graph no matter it is run after 0.1 or 0.2 quantile regression? So if I want to get a graph showing all the coefficients before weight for quantile 0.1,0.2,...,0.9 regression, should I just employ the graph plotted after quantile 0.5 (or 0.1 or any quantile) regression? Or should I employ the following codes? webuse auto, clear set seed 10101 sqreg price weight length foreign, quantile(0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75,0.8,0.9) reps(100) grqreg weight, ci ols olsci Hope to get your help. Thanks, Sharon
Open this post in threaded view
|
Report Content as Inappropriate

## AW: problem with grqreg after qreg

 <> " Then does it mean that grqreg will yield the same graph no matter it is run after 0.1 or 0.2 quantile regression?" Easy to find out: ************* webuse auto, clear qui forv i=1(2)9{         qreg price weight length turn foreign, q( `=`i'/10')         grqreg weight, ci ols olsci name(mygr`i', replace) } gr combine mygr1 mygr3 mygr5 mygr7 mygr9 ************* So the answer is "Yes", and any -qreg- run immediately before the -grqreg- call is apparently sufficient. BTW, the command is user-written from -ssc-. HTH Martin -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von xueliansharon Gesendet: Donnerstag, 1. Juli 2010 17:25 An: [hidden email] Betreff: st: problem with grqreg after qreg Hi all, In the following code, when I run grqreg after qreg, why do I get a curve instead of a point in this graph (say graph 1)? grqreg should plot the coefficient before weight for 0.5 quantile regression in my codes, which should be a point 3.933588 in the graph, so why does grqreg retrun a curve? The following are my codes: webuse auto, clear qreg price weight length turn foreign, quantile(0.5) grqreg weight, ci ols olsci Also, I check the coefficients of weight when running qreg for quantile 0.1, 0.2,0.3,...,0.9 respectively, and it seems like the coefficients before weight for each quantile regression are the same to the value in the graph1 (graph 1 is gotten by running grqreg after 0.5 quantile regression), that is, the coefficient before weight for 0.1 quantile regression is the same to the value in graph 1 for quantile 0.1,  is this correct? Then does it mean that grqreg will yield the same graph no matter it is run after 0.1 or 0.2 quantile regression? So if I want to get a graph showing all the coefficients before weight for quantile 0.1,0.2,...,0.9 regression, should I just employ the graph plotted after quantile 0.5 (or 0.1 or any quantile) regression? Or should I employ the following codes? webuse auto, clear set seed 10101 sqreg price weight length foreign, quantile(0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75,0.8,0.9) reps(100) grqreg weight, ci ols olsci Hope to get your help. Thanks, Sharon -- View this message in context: http://statalist.1588530.n2.nabble.com/problem-with-grqreg-after-qreg-tp5243782p5243782.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/* *   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/
Open this post in threaded view
|
Report Content as Inappropriate

## Re: AW: problem with grqreg after qreg

 Hi, Martin, Thanks for your information! it's very helpful! Then could you tell me whether I should use sqreg or qreg before grqreg if I want to get a graph plotting all the coefficients before weight for quantile 0.1,0.2,...,0.9 regression? The confidence bands in two graphs are different. Another question, if I want to get quantile regression estimates for quantile 0.1,0.2,0.3,..., should I use qreg for each quantile respectively or use sqreg?  I compare the results from qreg and sqreg, the values of estimates are the same, and the differences are standard errors, but this make a big difference when we consider about the significance. So which standard error is more reliable? qreg or sqreg? And is standard error the only difference between qreg and sqreg? Many thanks. Best, Sharon
Open this post in threaded view
|
Report Content as Inappropriate

## RE: Re: AW: problem with grqreg after qreg

 <> If you want analytic standard errors, go for the -qreg- solution, if not, go for -bootstrap-ped -sqreg- standard errors. The feature that adds value in the case of -sqreg- is that you can -test- across equations ([R], p. 1457), but it does not apply for a "univariate" plot of one coefficient... HTH Martin -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of xueliansharon Sent: Donnerstag, 1. Juli 2010 18:43 To: [hidden email] Subject: st: Re: AW: problem with grqreg after qreg Hi, Martin, Thanks for your information! it's very helpful! Then could you tell me whether I should use sqreg or qreg before grqreg if I want to get a graph plotting all the coefficients before weight for quantile 0.1,0.2,...,0.9 regression? The confidence bands in two graphs are different. Another question, if I want to get quantile regression estimates for quantile 0.1,0.2,0.3,..., should I use qreg for each quantile respectively or use sqreg?  I compare the results from qreg and sqreg, the values of estimates are the same, and the differences are standard errors, but this make a big difference when we consider about the significance. So which standard error is more reliable? qreg or sqreg? And is standard error the only difference between qreg and sqreg? Many thanks. Best, Sharon -- View this message in context: http://statalist.1588530.n2.nabble.com/problem-with-grqreg-after-qreg-tp5243782p5244163.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/* *   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/