FAQ/fishrpow - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the odd letters out: scieNce GATHeRS knowledge fAster tHAN SOCIeTY GATHErS wisdom

location: FAQ / fishrpow

Comparing correlations form two separate samples using fisher's transformation in R

Copy and paste the below into R.

fn <- function(r1,r2,n1,n2,alpha) {

a <- abs((1+r1)/(1-r1))
b <- abs((1+r2)/(1-r2))
a <- 0.5*log(a)
b <- 0.5*log(b)
c <- 1/(n1-3)
d <- 1/(n2-3)
chisq <- abs((a-b)/sqrt(c+d))

pow <- 1 - pchisq(abs(qchisq(1-alpha,1)),1,chisq*chisq)
cat("Power for Fisher's test is")
print(pow)
 }

Input the (two-tailed) type one error, alpha, correlations, r1 and r2, and sample sizes, n1 and n2 as below into R.

alpha <- 0.05
r1 <- 0.7
r2 <- 0.8
n1 <- 67
n2 <- 10000

then copy and paste, or type in, the below to obtain the power.

fn(r1,r2,n1,n2,alpha)