/* This program provides asymptotic sample sizes for detecting a correlation based on .5 log[(1+r)/(1-r)] The input is rho=Population Correlation Coefficient (>0 and <1) Alpha=size of Type I error (fraction or percent) Power=1-size of type 2 error The output is sample size for both 1-sided and 2-sided tests. */ data a;input rho alpha power; if alpha>1 then alpha=alpha/100; if power>1 then power=power/100; lg=.5*log((1+rho)/(1-rho)); za=-probit(alpha);za2=-probit(alpha/2); zb=probit(power); n1=((za+zb)**2)/(lg**2); n2=((za2+zb)**2)/(lg**2); cards; .20 .05 .8 .30 .08 .8 data a;set a; file print; k=_n_; n1=int(n1+.5);n2=int(n2+.5); if k=1 then do; put @10 // 'Sample Sizes for Correlations based on the log transformation'; put // @10 'Alpha' @20 'Power' @30 'RHO' @40 'N (1-sided)' @54 'N (2-sided)'; put @10 //; end; put @10 alpha @20 power @30 rho @40 n1 @54 n2; run;