Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: adding horizontal and vertical line,


From   "Tiago V. Pereira" <[email protected]>
To   [email protected]
Subject   RE: st: adding horizontal and vertical line,
Date   Fri, 28 Oct 2011 12:19:46 -0200 (BRST)

You need to summarize your variables, and save the means in locals, then
you use the option xline() and yline()

*/ -------- start example ----------
clear
set obs 1000
gene a = rnormal()
gene b = runiform()
sum a, meanonly
local a = r(mean)
sum b, meanonly
local b = r(mean)
scatter a b, xline(`b') yline(`a')
*/ -------- end -----------------------


--------
Dear statalist.

I drew a scatter plot and want to add horizontal line with mean( x
values) and vertical line with mean (y values).

Do you have any idea?

Thanks.
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index