comment This program computes the sample size necessary to achieve target levels of accuracy comment for squared correlation and partial correlation coefficients such as are reported in Table 2 in comment Algina and Olejnik (2003). comment The squared population correlation can be changed by changing .00 in the code rhosq = .00. comment The target level of accuracy can be changed by changing .05 in the code c = .05. comment The probability can be changed by changing .95 in the code prob=.95. comment The number of control variables can be changed by changing 0 in the code q=0. NEW file. INPUT PROGRAM. compute rhosq= 0.00 . compute c =.05. compute prob=.95. compute q=0. compute #d=0. compute #rhotids=rhosq/(1-rhosq). compute rll=rhosq-c. compute rul=rhosq+c. if (rul>=1.0) rul=.99999. if (rll<0) rll=0. loop #n=q+3 to 10000. compute #df=#n-q-1. compute #df2=#n-q-2. compute #rtul=rul/(1-rul). compute #rtll=rll/(1-rll). compute #gamma=sqrt(1+#rhotids). compute #phi1=#df*(#gamma**2-1)+1. compute #phi2=#df*(#gamma**4-1)+1. compute #phi3=#df*(#gamma**6-1)+1. compute #g=(#phi2-sqrt(#phi2**2-#phi1*#phi3))/#phi1. compute #nu=(#phi2-2*#rhotids*#gamma*(sqrt(#df*#df2)))/(#g**2). compute #lambda=(#rhotids*#gamma*(sqrt(#df*#df2)))/(#g**2). compute #ul=(#df2/(#nu*#g))*#rtul. compute #sl=(#df2/(#nu*#g))*#rtll. compute #pu=NCDF.F(#ul,#nu,#df2,#lambda). compute #pl=NCDF.F(#sl,#nu,#df2,#lambda). compute #d=#pu-#pl. END LOOP if (#d>=prob). compute n=#n. compute prob=prob. END CASE. END FILE. END INPUT PROGRAM. EXECUTE.