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

Re: st: Stata 8 graphics -adding ylines on TOP of lfitci?


From   [email protected] (Jeff Pitblado, Stata Corp.)
To   [email protected]
Subject   Re: st: Stata 8 graphics -adding ylines on TOP of lfitci?
Date   Fri, 17 Oct 2003 15:11:15 -0500

Michael Blasnik <[email protected]> asks about drawing horizontal
lines that will not be covered up by other plots:

> I've finally taken the plunge into trying to learn more fully the Stata8
> graphics and I keep coming up with problems that I can't solve with the
> manual or can only solve after way too long of a hunt (I think the manual
> need many more examples and topics are hard to find).
> 
> Anyway, I was wondering whether anyone has figured out how to add a
> reference line (a yline) on top of a graph made with lfitci.  The shaded
> confidence interval always appears on top of any lines I try to create -- 
> using yline options for the lfitci graph, yline options for the second
> (scatter) graph specified , adding a twoway function plot, etc.  I'm still
> trying different approaches, but have already spent about 2 frustrating
> hours trying to solve this hopefully simple problem.

-yline()-'s are emphasized lines that are part of the y-axis, and like
gridlines are therefore drawn before any of the plots.

Michael can plot a reference line by using -twoway function-, and it will be
the last "thing" drawn so long as it is the last "thing" specified on the
-graph- command.  The only drawback here is that the horizontal range must be
specified.

For example:

	. clear
	. sysuse auto
	. twoway lfitci mpg turn || function y = 15, range(turn) clcolor(red)

--Jeff
[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