Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: CIs around Qreg trend line

From   "Nick Cox" <>
To   <>
Subject   RE: st: CIs around Qreg trend line
Date   Mon, 15 Mar 2010 20:41:27 -0000

sysuse auto, clear 
gen gpm = 1/mpg
qreg gpm weight 
predict pred 
predict se, stdp  
local level = (100 - 95) / 200  
gen ul = pred + invttail(e(df_r), `level') * se 
gen ll = pred - invttail(e(df_r), `level') * se 
twoway rarea ll ul weight, sort astyle(ci) || ///
line pred weight, sort || ///
scatter gpm weight, legend(off) ytitle(Gallons per mile)


Jeffrey B. Wolpin

In Stata 10, assuming a qreg regression with one predictor, is there a
way to develop confidence intervals around the qreg trend line (or any
quantile for that matter)?

Also, once developed, what would be the syntax to then graph the scatter
plot, trend line and confidence intervals?

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index