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

RE: st: corcor

From   "Nick Cox" <>
To   <>
Subject   RE: st: corcor
Date   Tue, 10 Mar 2009 15:05:43 -0000

Correlations are often awkward to deal with. Manifestly their bounds are [-1,1] and those bounds can bite. 

A different handle on your question might to be look at confidence intervals. There is machinery in -corrci- from the Stata Journal. 

SJ-8-3  pr0041  .  Speaking Stata: Corr. with confidence, Fisher's z revisited
        (help corrci, corrcii if installed) . . . . . . . . . . . .  N. J. Cox
        Q3/08   SJ 8(3):413--439
        reviews Fisher's z transformation and its inverse, the
        hyperbolic tangent, and reviews their use in inference
        with correlations


Maarten buis

--- On Tue, 10/3/09, <> wrote:
> Are there any functions like corcor (H0:
> cor(x1x2)=cor(x1x3)) that test
> cor(x1x2)=cor(x3x4)?

A rather roundabout way of doing that (and others may come up
with much smarter solutions) is to use the fact that the 
correlation is the bivariate regression coeficient when both
the dependent and independent variable have been standardized:

*-------------- begin example ----------------------
sysuse auto, clear
corr mpg weight displacement

local vars "mpg weight displacement"
foreach var of varlist `vars' {
	sum `var'
	gen double z_`var' = (`var'-r(mean))/r(sd)
reg z_mpg z_weight
est store a

reg z_mpg z_displacement
est store b

suest a b
test [a_mean]_b[z_weight] = [b_mean]_b[z_displacement]
lincom [a_mean]_b[z_weight] - [b_mean]_b[z_displacement]
*-------------------- end example ------------------------
(For more on how to use examples I sent to the Statalist, see )

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index