::Free Statistics and Forecasting Software::

v1.2.1

:: Testing difference between two correlations ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This R module tests the difference between two Pearson correlations. Given 3 variables, x, y, z, the software tests whether the correlation between xy is different from the correlation between xz. If y and z are independent, this is a simple t-test of the z transformation. If, however, x and y are dependent, the software also takes into account the correlation between yz.

Enter (or paste) your data delimited by hard returns.

 Send output to: Browser Blue - Charts White Browser Black/White CSV Data X (click to load default data) 99.2 99 100 111.6 122.2 117.6 121.1 136 154.2 153.6 158.5 140.6 136.2 168 154.3 149 165.5 Data Y: 96.7 98.1 100 104.9 104.9 109.5 110.8 112.3 109.3 105.3 101.7 95.4 96.4 97.6 102.4 101.6 103.8 Data Z: 101 100.1 100 90.6 86.5 89.7 90.6 82.8 70.1 65.4 61.3 62.5 63.6 52.6 59.7 59.5 61.3 Paired or Unpaired? unpairedpaired Chart options Width: Height:

 Source code of R module library(psych) xy <- cor(x,y,use = "pairwise") xz <- cor(x,z,use = "pairwise") yz <- cor(y,z,use = "pairwise") nx <- length(na.omit(x)) ny <- length(na.omit(y)) nz <- length(na.omit(z)) nxy <- min(nx,ny) nxz <- min(nx,nz) if(par1=="paired") { r <- paired.r(xy,xz,yz,n=nxy,n2=nxz) } else { r <- paired.r(xy,xz,n=nxy,n2=nxz) } print(r) load(file="createtable") a<-table.start() a<-table.row.start(a) a<-table.element(a,"Testing difference between two Pearson Correlations",2,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Pearson Correlation between X and Y",header=TRUE) a<-table.element(a,xy) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Pearson Correlation between X and Z",header=TRUE) a<-table.element(a,xz) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Type of test",header=TRUE) a<-table.element(a,par1) a<-table.row.end(a) if(par1=="paired") { a<-table.row.start(a) a<-table.element(a,"t-Test for dependent correlations",header=TRUE) a<-table.element(a,r\$t) a<-table.row.end(a) } else { a<-table.row.start(a) a<-table.element(a,"z-Test for independent correlations",header=TRUE) a<-table.element(a,r\$z) a<-table.row.end(a) } a<-table.row.start(a) a<-table.element(a,"P-value (H0: r(xy) = r(xz))",header=TRUE) a<-table.element(a,r\$p) a<-table.row.end(a) a<-table.end(a) table.save(a,file="mytable.tab")
 Top | Output | Charts | References

 Cite this software as: Patrick Wessa (2017) Testing difference between correlations (v1.0.7) in Free Statistics Software (v1.2.1), Office for Research Development and Education, URL https://www.wessa.net/rwasp_CompareCorrelations.wasp/ The R code is based on :
 Top | Output | Charts | References