*This program computes a confidence interval for the squared multiple correlation coefficient for the design in which values of the independent variables are sampled. To use the program you input n--the sample size k--the number of predictors rsq--the sample squared multiple correlation coefficient conlevel--the confidence level for the interval; data; n=117; k=2; rsq=.1245; conlev=.95; pul=(1-conlev)/2; pll=1-(1-conlev)/2; df1=n-1; df2=n-k-1; rtildesq=rsq/(1-rsq); switch=0; switch1=0; test=probf((n-k-1)*rtildesq/k,k,n-k-1); if test <=pul then do; switch=1; llrhosq=0; ulrhosq=0; ulrhotildesq=0; llrhotildesq=0; end; if test <=pll then do; switch1=1; llrhosq=0; llrhotildesq=0; end; x2=.99999; x1=.00001; x3=.5; diff3=1; if switch=0 then do while (abs(diff3)>.00001); x3=(x1+x2)/2; yy=x3/(1-x3); gamma=sqrt(1+yy); phi1=df1*(gamma**2-1)+k; phi2=df1*(gamma**4-1)+k; phi3=df1*(gamma**6-1)+k; g=(phi2-(sqrt(phi2**2-phi1*phi3)))/phi1; nu=(phi2-2*yy*gamma*(sqrt(df1*df2)))/g**2; lambdau=yy*gamma*(sqrt(df1*df2))/g**2; limit=df2*rtildesq/(nu*g); diff3=probf(limit,nu,df2,lambdau)-pul; yy=x1/(1-x1); gamma=sqrt(1+yy); phi1=df1*(gamma**2-1)+k; phi2=df1*(gamma**4-1)+k; phi3=df1*(gamma**6-1)+k; g=(phi2-(sqrt(phi2**2-phi1*phi3)))/phi1; nu=(phi2-2*yy*gamma*(sqrt(df1*df2)))/g**2; lambdau=yy*gamma*(sqrt(df1*df2))/g**2; limit=df2*rtildesq/(nu*g); diff1=probf(limit,nu,df2,lambdau)-pul; if diff1*diff3<0 then x2=x3;else x1=x3; ulrhosq=x3; end;*for do while; x2=.99999; x1=.00001; x3=.5; if switch =0 & switch1=0 then do; yy=x3/(1-x3); gamma=sqrt(1+yy); phi1=df1*(gamma**2-1)+k; phi2=df1*(gamma**4-1)+k; phi3=df1*(gamma**6-1)+k; g=(phi2-(sqrt(phi2**2-phi1*phi3)))/phi1; nu=(phi2-2*yy*gamma*(sqrt(df1*df2)))/g**2; lambdau=yy*gamma*(sqrt(df1*df2))/g**2; limit=df2*rtildesq/(nu*g); diff3=probf(limit,nu,df2,lambdau)-pll; do while (abs(diff3)>.00001); x3=(x1+x2)/2; yy=x3/(1-x3); gamma=sqrt(1+yy); phi1=df1*(gamma**2-1)+k; phi2=df1*(gamma**4-1)+k; phi3=df1*(gamma**6-1)+k; g=(phi2-(sqrt(phi2**2-phi1*phi3)))/phi1; nu=(phi2-2*yy*gamma*(sqrt(df1*df2)))/g**2; lambdau=yy*gamma*(sqrt(df1*df2))/g**2; limit=df2*rtildesq/(nu*g); diff3=probf(limit,nu,df2,lambdau)-pll; yy=x1/(1-x1); gamma=sqrt(1+yy); phi1=df1*(gamma**2-1)+k; phi2=df1*(gamma**4-1)+k; phi3=df1*(gamma**6-1)+k; g=(phi2-(sqrt(phi2**2-phi1*phi3)))/phi1; nu=(phi2-2*yy*gamma*(sqrt(df1*df2)))/g**2; lambdau=yy*gamma*(sqrt(df1*df2))/g**2; limit=df2*rtildesq/(nu*g); diff1=probf(limit,nu,df2,lambdau)-pll; if diff1*diff3<0 then x2=x3;else x1=x3; llrhosq=x3; end;*for do while; end; llrhosq=round(llrhosq,.001); ulrhosq=round(ulrhosq,.001); proc print; var n k rsq conlev llrhosq ulrhosq ; quit;