Avril Coghlan
2004-Jul-27 12:35 UTC
[R] test for difference between non-independent correlations
Hello, I am wondering whether there is a way to test whether two non-independent correlation coefficients are significantly different, in R? I have an experimentally measure variable Y, and two different variables X1, and X2, which are predictions of Y that were predicted using two different computational models. I would like to see whether the correlation of Y and X1, and Y and X2 is significantly different. Since Y appears in both correlations the correlation coefficients will be non-independent. (so you cannot use a Z test like you would for comparing independent correlation coefficients, I think). I have read that there is a test for comparing non-independent correlation coefficients, by EJ Williams (1959) and Steiger. There is also a test called Hotelling's t test. I'm wondering does anyone know whether I can somehow carry out any of these using an R package, or compare non-independent correlations using R by some other method? I will greatly appreciate any help, thankyou, Avril Coghlan (University College Dublin, Ireland)
Jonathan Baron
2004-Jul-27 13:05 UTC
[R] test for difference between non-independent correlations
On 07/27/04 13:35, Avril Coghlan wrote:>Hello, > > I am wondering whether there is a way to >test whether two non-independent correlation >coefficients are significantly different, in R?About 20 years ago I asked the same question (without the "R"), found Steiger's paper (below) and wrote this BASIC program to do it. (If you try to type it in each time you're bound to make a mistake. This has been checked repeatedly.) It is trivial to write this as an R script, of course. I and my colleagues have been using this for about 20 years, and it seems to be OK as judged by comparing it to the jackknife. (Remember, when we did this, the "bootstrap" was a newfangled idea that we didn't quite trust.) My hunch is that something better has come along, and I'd be interested to see how others respond. Hence I haven't bothered to translate this into R. Or maybe everyone who has this problem just uses the bootstrap now. That is certainly easy enough. (I will eventually add this to our "Notes on R for psychology...," since it is a very common problem in psychology research.) 10 print "looks for difference between r12 and r13, given r23" 12 print "(input r12>1 to quit)" 20 input "r12 "; r12 22 if r12>1 then end 30 input "r13 "; r13 40 input "r23 "; r23 50 input "N "; n 52 let rd=1-r12*r12-r13*r13-r23*r23+2*r12*r13*r23 54 let rb=(r12+r13)/2 56 let cube=(1-r23)*(1-r23)*(1-r23) 60 let t2=(r12-r13)*sqrt((n-1)*(1+r23)/(2*rd*(n-1)/(n-3)+rb*rb*cube)) 70 print "t (";n-3;") = ";t2 80 print "Steiger, J.H. (1980). Tests for comparing elements of a 82 print "correlation matrix. Psychological Bulletin, 87, 245-251." 100 goto 12 -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R search page: http://finzi.psych.upenn.edu/