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 a line to a scatter plot


From   "Data Analytics Corp." <[email protected]>
To   [email protected]
Subject   Re: st: Adding a line to a scatter plot
Date   Tue, 29 Mar 2011 10:04:16 -0400

Hi,

I received two good solutions very quickly. I'm right at the point where I need to draw that ray so I'll try both.

Thanks for the help,

Walt

________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
[email protected]
www.dataanalyticscorp.com
_____________________________________________________

On 3/29/2011 9:53 AM, Nick Cox wrote:
Here is one way to do it:

sysuse auto
su weight, meanonly
local mean_w = r(mean)
su length, meanonly
local mean_l = r(mean)
sc weight length || scatteri 0 0 `mean_w' `mean_l', recast(line)

Nick

On Tue, Mar 29, 2011 at 2:41 PM, Data Analytics Corp.
<[email protected]>  wrote:

I created a simple scatter plot but now I would like to add a ray from the
origin that goes through the point defined by mean X and mean Y.  The two
line options xline and yline are for vertical and horizontal lines,
respectively.  I don't see how to draw a line from the origin through a
specific point.  Any suggestions?
*
*   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/


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