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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: - graph matrix - with regression lines


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: - graph matrix - with regression lines
Date   Wed, 21 Apr 2010 18:07:41 +0100

I don't think so. I think you have to loop over pairs of variables and
then -graph combine-. About half the code you need is in -cpyxplot- from
SSC. 

Nick 
n.j.cox@durham.ac.uk 

Philipp Rehm

is there a way to add regression lines (like in -graph twoway lfit- or 
-graph twoway qfit-) to a scatterplot matrix produced by -graph matrix-?

Here is an example of such a scatterplot matrix:

sysuse citytemp, clear
graph mat heatdd-tempjuly, ms(p) maxes(ylab(#4) xlab(#4))

I would like to add regression lines to each of the plots, as in this 
example:

tw (scatter  heatdd cooldd) (lfit heatdd cooldd)

Can this be done?

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index