Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Graphic question V8: graphing adjusted values with CI


From   "Moran, John (NWAHS)" <[email protected]>
To   "'Statalist (Statalist)'" <[email protected]>
Subject   st: Graphic question V8: graphing adjusted values with CI
Date   Mon, 3 Mar 2003 14:06:16 +1030

Dear Statalisters

Exploring the new graphics (tentatively) in V8 (running SE, updated to 30
Jan exec, 25 Feb ado), I am trying to plot a fairly basic function, adjusted
values, of a regression, but am having trouble doing it all via the graphic
GUI. So:

regress  price mpg weight displacement
adjust  weight displacement, by( mpg) se gen(abc def)
gen  def_l=abc-1.96* def
gen de_u=abc+1.96* def

I then try to plot the predicted values, upper and lower CI using the GUI; I
get to this without tooo much trouble:

twoway (scatter price mpg, msymbol(none)) (scatter abc mpg, msymbol(diamond)
msize(small)) ///
(line def_l mpg, sort clpat(dash) clwidth(medthin)) ///
(line de_u mpg, sort clpat(dash) clwidth(medthin)) 

But I still have to draw the solid line of the linear predictor through the
diamond symbols; so back to the command line:

twoway (scatter price mpg, msymbol(none)) (scatter abc mpg, msymbol(diamond)
msize(small)) ///
(line def_l mpg, sort clpat(dash) clwidth(medthin)) ///
(line de_u mpg, sort clpat(dash) clwidth(medthin)) ///
(line abc mpg, sort clpat(solid) clwidth(medium)) 

Now it all comes out nicely in the end (at least on my machine!!), but the
limitation to 4 overlays seems frustrating for a basic function such as
plotting the adjusted means of a regression. Now there is "regpred" plus
other functions by J. Garrett in V7, but the graphics are obviously not V8
quality. 

Have I missed something initially in the set up of the initial plots such
that this can all be done in 4 overlays? Cannot seem to do it at this end,
but.............

Advice on this is much appreciated


Yours sincerely


John moran





John L Moran 
Intensive Care Unit
The Queen Elizabeth Hospital
28 Woodville Road Woodville
SA 5011
Australia
Tel  61 08 8222 6463
Fax 61 08 8222 6045
E-mail: [email protected]

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index