[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Linear regression, correlation coefficient and Stat 8 Graphs
It is often simplest just to run -correlate- and then
put a suitably rounded result in some title.
However, the following shows how this could be
. sysuse auto
. gen gpm = 1 / mpg
. corr gpm weight
. local corr : di %5.3g r(rho)
. twoway lfit gpm weight || scatter gpm weight , subtitle("correlation `corr'")
> 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.
* For searches and help try: