Statalist


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

RE: st: corcor


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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

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

Maarten buis

--- On Tue, 10/3/09, jasonm@ucla.edu <jasonm@ucla.edu> 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
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )


*
*   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   |   What's new   |   Site index