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

Re: st: corcor

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

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

Hope this helps, 

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


*   For searches and help try:

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