Statalist


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

Re: st: corcor


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: corcor
Date   Tue, 10 Mar 2009 08:43:16 +0000 (GMT)

--- On Tue, 10/3/09, [email protected] <[email protected]> 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 )

Hope this helps, 
Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------




      

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index