**********************************************************************************************
**********************************************************************************************
***********************        Spearman-Brown Phophecy Formula        ************************
***********************         Ron D. Hays                           ************************
***********************         2022                                  ************************
**********************************************************************************************
/***********************************************************************************************/
options ls=78 ps=56 nocenter;
ods pdf file="c:\Projects\spear.pdf";

**************************;
Title "Spearman-Brown Prophecy Formula";
run;
******************************************************************;  
data spear; 
* RELIABILITY AND NUMBER OF ITEMS IN ORIGINAL SCALE***************;
R1=0.29;I1=1;
**********************;
*TARGET RELIABILITY*************************;
R2=0.70;
R3=0.80;
R4=0.90;
******************************************************************;
NUM1=R2*(R1-1);
DEN1=R1*(R2-1);
NFOR70=(NUM1/DEN1)*I1;
NUM2=R3*(R1-1);
DEN2=R1*(R3-1);
NFOR80=(NUM2/DEN2)*I1;
NUM3=R4*(R1-1);
DEN3=R1*(R4-1);
NFOR90=(NUM3/DEN3)*I1;
*********************************;
I=0;R5=0;
IF I1>1 THEN DO;
I=I+1;
I2=I-1;
RATIO=I2/I;
RATIO2=RATIO-1;
R5=(RATIO*R1)/(1+(RATIO2*R1));
END;
*************************************;
label 
I1 = "NUMBER OF ITEMS IN ORIGINAL SCALE"
R1 = "RELIABILITY OF ORIGINAL SCALE"
R2 = "0.70 RELIABILITY"
R3 = "0.80 TARGET RELIABILITY"
R4 = "0.90 TARGET RELIABILITY"
NFOR70= "NUMBER OF ITEMS FOR 0.70 RELIABILITY"
NFOR80= "NUMBER OF ITEMS FOR 0.80 RELIABILITY"
NFOR90= "NUMBER OF ITEMS FOR 0.90 RELIABILITY"
I = "IF > 0 THEN PROJECTED NUMBER OF ITEMS"
R5 = "IF > 0 THEN PROJECTED RELIABILITY FOR I ITEMS"
;
RUN;
************************************************;
PROC PRINT LABEL;
VAR I1 R1 NFOR70 NFOR80 NFOR90 I R5;
RUN;
************************************;
ods pdf close;