Testing correlations in SAS

328 views
Skip to first unread message

Eva M Andersson

unread,
May 14, 2012, 2:39:20 AM5/14/12
to MedS...@googlegroups.com

Hello!

 

I have four variables (X1, X2, X3, X4), measured on the same n subjects, and I calculate 6 pairwise correlations (r12, r13, r14, r23, r24, r34).

I want to test if there is a significant difference between two of these (H0: rho12=rho14).

 

Which command would I use in SAS to perform this test?

 

Best regards   

 

Eva Andersson

Occupational and environmental medicin, Sahlgrenska University hospital, Gothenburg

Sweden

 

ציפי שוחט

unread,
May 14, 2012, 3:32:27 AM5/14/12
to meds...@googlegroups.com
Dear Eva.
You can use Fisher's Z-Test  http://vassarstats.net/rdiff.html 

I'm not sure if SAS has any direct command for this, but try searching SAS-Help for Fisher Z-Test

Tzippy Shochat

2012/5/14 Eva M Andersson <eva.m.a...@amm.gu.se>

--
To post a new thread to MedStats, send email to MedS...@googlegroups.com .
MedStats' home page is http://groups.google.com/group/MedStats .
Rules: http://groups.google.com/group/MedStats/web/medstats-rules

Swank, Paul R

unread,
May 14, 2012, 10:18:07 AM5/14/12
to meds...@googlegroups.com

Fisher’s Z test would require that the correlations be independent. They aren’t. see

http://www.quantitativeskills.com/sisa/statistics/corrhlp.htm

 

 

Dr. Paul R. Swank,

Children's Learning Institute

Professor, Department of Pediatrics, Medical School

Adjunct Professor, School of Public Health

University of Texas Health Science Center-Houston

Bruce Weaver

unread,
May 14, 2012, 3:36:06 PM5/14/12
to MedStats
Karl Wuensch has a couple relevant documents on his website too:

http://core.ecu.edu/psyc/wuenschk/StatHelp/StatHelp.htm

See the 8th and 9th links from the top.

Cheers,
Bruce


On May 14, 10:18 am, "Swank, Paul R" <Paul.R.Sw...@uth.tmc.edu> wrote:
> Fisher's Z test would require that the correlations be independent. They aren't. seehttp://www.quantitativeskills.com/sisa/statistics/corrhlp.htm
>
> Dr. Paul R. Swank,
> Children's Learning Institute
> Professor, Department of Pediatrics, Medical School
> Adjunct Professor, School of Public Health
> University of Texas Health Science Center-Houston
>
> From: meds...@googlegroups.com [mailto:meds...@googlegroups.com] On Behalf Of ???? ????
> Sent: Monday, May 14, 2012 2:32 AM
> To: meds...@googlegroups.com
> Subject: Re: {MEDSTATS} Testing correlations in SAS
>
> Dear Eva.
> You can use Fisher's Z-Test  http://vassarstats.net/rdiff.html
>
> I'm not sure if SAS has any direct command for this, but try searching SAS-Help for Fisher Z-Test
>
> Tzippy Shochat
> 2012/5/14 Eva M Andersson <eva.m.anders...@amm.gu.se<mailto:eva.m.anders...@amm.gu.se>>
> Hello!
>
> I have four variables (X1, X2, X3, X4), measured on the same n subjects, and I calculate 6 pairwise correlations (r12, r13, r14, r23, r24, r34).
> I want to test if there is a significant difference between two of these (H0: rho12=rho14).
>
> Which command would I use in SAS to perform this test?
>
> Best regards
>
> Eva Andersson
> Occupational and environmental medicin, Sahlgrenska University hospital, Gothenburg
> Sweden
>
> --
> To post a new thread to MedStats, send email to MedS...@googlegroups.com<mailto:MedS...@googlegroups.com> .

Ray Koopman

unread,
May 15, 2012, 3:18:16 AM5/15/12
to MedStats
You want Steiger's modification of the Pearson-Filon test. See
http://groups.google.com/group/sci.stat.edu/browse_frm/thread/e9d8d8b401008a8e

On May 13, 11:39 pm, Eva M Andersson <eva.m.anders...@amm.gu.se>
wrote:

Ray Koopman

unread,
May 15, 2012, 3:21:23 AM5/15/12
to MedStats
Cancel that. I misread the question. X3 is not involved, so you want
Williams' modification of Hotelling's test.

On May 15, 12:18 am, Ray Koopman <koop...@sfu.ca> wrote:
> You want Steiger's modification of the Pearson-Filon test. Seehttp://groups.google.com/group/sci.stat.edu/browse_frm/thread/e9d8d8b...

Bruce Weaver

unread,
May 15, 2012, 3:45:29 PM5/15/12
to MedStats
Ray reminded me that Dave Howell describes Williams' test in his book
"Statistical Methods for Psychology". I just looked it up and wrote
some SPSS syntax to compute it. It should not be too difficult for a
SAS user to convert it.

Cheers,
Bruce


* ================================================ .
* File name: Williams1959.sps .
* Written by: Bruce Weaver, bwe...@lakeheadu.ca
* Date: 15-May-2012.
* ================================================ .

* SPSS program to compute Williams' (1959) test for
* comparing two correlations with one variable in common.
* The example used here is from Dave Howell's book
* "Statistical Methods for Psychology" (6th Ed., p. 262).
* It assumes the user wants the difference r12 - r13.
* This example reads in only one row of data, but one could
* read in several rows of data, with one test per row.

data list list / r12 r13 r23 (3f5.3) n (f5.0).
begin data
0.80 0.72 0.89 26
end data.

compute #R = (1 - r12**2 - r13**2 - r23**2) +
2*r12*r13*r23.
compute diff = r12 - r13.
compute t = diff *
SQRT( ((n-1)*(1+r23)) /
(2*((n-1)/(n-3))*#R +
((r12+r13)**2/4)*
(1-r23)**3) ).
compute df = n-3.
compute p = cdf.t(abs(t)*-1,df)*2.
formats t p diff (f5.3) / df (f5.0).
list r12 r13 diff t df p.

OUTPUT:

r12 r13 diff t df p
.800 .720 .080 1.361 23 .187

Number of cases read: 1 Number of cases listed: 1

Swank, Paul R

unread,
May 15, 2012, 4:31:40 PM5/15/12
to meds...@googlegroups.com
data corr;
input (r12 r13 r23)(5.3) n 5.0;

R = (1 - r12**2 - r13**2 - r23**2) + 2*r12*r13*r23;
diff = r12 - r13;
t = diff *SQRT( ((n-1)*(1+r23)) /
(2*((n-1)/(n-3))*R +
((r12+r13)**2/4)*
(1-r23)**3));
df = n-3;
p = (1-probt(abs(t),df))*2;
datalines;
0.80 0.72 0.89 26
;

proc print;
var r12 r13 diff t df p;

run;

Obs r12 r13 diff t df p

1 0.8 0.72 0.08 1.36067 23 0.18680

Dr. Paul R. Swank,
Children's Learning Institute
Professor, Department of Pediatrics, Medical School
Adjunct Professor, School of Public Health
University of Texas Health Science Center-Houston


--
To post a new thread to MedStats, send email to MedS...@googlegroups.com .
Reply all
Reply to author
Forward
0 new messages