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

Re: st: Linear regression, correlation coefficient and Stat 8 Graphs


From   "Oleksandr Talavera, EUV" <[email protected]>
To   [email protected]
Subject   Re: st: Linear regression, correlation coefficient and Stat 8 Graphs
Date   Fri, 30 Apr 2004 14:58:30 +0200

I do not know whether it is a good idea to add r-sq to title, but it can be done as:

sysuse auto
reg mpg price
local a = int(e(r2)*100)/100
twoway (scatter mpg price) (lfit mpg price), title(" title blah-blah, r-sq =0`a'")

best,
sasha

Oliver Morgan wrote:


I have produced a twoway scatter plot to which I have fitted a linear
prediction plot using the lfit option in Stata 8.

However, I would also like to present the correlation coefficient (r) on
this graph.

Can anybody help me with this?

Thanks

Oliver





For the latest data on the economy and society consult National Statistics at http://www.statistics.gov.uk

**********************************************************************
Please Note: Incoming and outgoing email messages
are routinely monitored for compliance with our policy
on the use of electronic communications
**********************************************************************
Legal Disclaimer : Any views expressed by
the sender of this message are not necessarily
those of the Office for National Statistics
**********************************************************************

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
*
* 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/




*
*   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