data sample size; *** This SAS program was written by Hittner, May and Silver, 2008. This program performs Yoo and Spoth's 1993 procedure for sample size determination. The approach is used when there are binomially distributed outcomes, and the procedure is referred to as "the conditional binomial method using adjusted proportions (or, alternatively, adjusted prevalence rates)." Below, specify the time 1 proportion "Ptime1", the time 2 proportion "Ptime2", the proportional change from time 1 to time 2 "Pchange" for those participants receiving the intervention or manipulation versus the control group, the desired alpha level "alpha" (e.g., .05), and the desired level of power "power" (e.g., .80) ***; Ptime1 = .46; Ptime2 = .61; Pchange = .70; alpha = .05; power = .80; ********* Yoo and Spoth's effect size index *******************************; effsize = Pchange * (Ptime2-Ptime1); **********************************************************************; ************* Expected time 2 proportion for the time 1 control group *****; Expt2con = Ptime2; **********************************************************************; ************* Expected time 2 proportion for the time 1 treatment group *****; Expt2treat = Ptime2-effsize; **********************************************************************; **** Estimated n per group for two indep proportions (arcsine transformation) ****; p1a = ARSIN(sqrt(Expt2con)); p2a = ARSIN(sqrt(Expt2treat)); H = 2*(abs(p1a-p2a)); zalph = 1-alpha; za = (quantile('NORMAL',zalph)); zp = quantile('NORMAL',power); npgindep = (2*(zp+za / H))**2; *****************************************************************************************; ****** Estimated n per group using Miettinen's (1968) matched pairs procedure *******; delta = Expt2treat-Expt2con; psi = (Expt2treat * (1-Expt2con)) + ((1-Expt2treat) * Expt2con); quanta = 1-alpha; qalpha = quantile('NORMAL',quanta); qbeta = quantile('NORMAL',power); npgmatched = ((qalpha*psi)+(qbeta*sqrt(psi**2-(0.25*delta**2*(3+psi)))))**2 / (psi*delta**2); *****************************************************************************************; ***** Adjusted proportion/prevalence rate for the control group (for independent groups) *****; x1i = npgindep * (Ptime2-Ptime1); xbi = npgindep * Ptime1; Pconadji = x1i / (npgindep-xbi); **************************************************************************************; ***** Adjusted proportion/prevalence rate for the treatment group (for independent groups) *****; x2i = npgindep * ((Ptime2-Ptime1) - effsize); Ptreatadji = x2i / (npgindep-xbi); *****************************************************************************************; ***** Other needed quantities per Yoo and Spoth (for independent groups) ********; Pbi = xbi / npgindep; varind1 = (Pconadji*(1-Pconadji))/(npgindep-xbi); varind2 = (Ptreatadji*(1-Ptreatadji))/(npgindep-xbi); vardiffi = varind1+varind2; **********************************************************************************; *********** Calculate Z beta (for independent groups) ******************************************************************************; Zbnegi = qalpha-((Pconadji-Ptreatadji)/sqrt(vardiffi)); Zbetai = -1 * Zbnegi; ********************************************************************************************************************************; ****Calculate sample size per group via the conditional binomial method for Independent Proportions****; numeri = (Pconadji*(1-Pconadji))+(Ptreatadji*(1-Ptreatadji)); denomi = ((Pconadji-Ptreatadji)**2)*(1-Pbi); ratioi = numeri / denomi; qz = -1 * quantile('NORMAL',Pchange); ncbinindep = ((qz+Zbetai)**2)*ratioi; **********************************************************************************************************; ***** Adjusted proportion/prevalence rate for the control group (for matched pairs) *****; x1 = npgmatched * (Ptime2-Ptime1); xb = npgmatched * Ptime1; Pconadj = x1 / (npgmatched-xb); **********************************************************************; **** Adjusted proportion/prevalence rate for the treatment group (for matched pairs) *****; x2 = npgmatched * ((Ptime2-Ptime1) - effsize); Ptreatadj = x2 / (npgmatched-xb); **********************************************************************; **** Other needed quantities per Yoo and Spoth (for matched pairs)****; Pb = xb / npgmatched; varmat1 = (Pconadj*(1-Pconadj))/(npgmatched-xb); varmat2 = (Ptreatadj*(1-Ptreatadj))/(npgmatched-xb); vardiffm = varmat1+varmat2; **********************************************************************; *********** Calculate Z beta (for matched pairs) **********************************************************; Zbneg = qalpha-((Pconadj-Ptreatadj)/sqrt(vardiffm)); Zbeta = -1 * Zbneg; ***********************************************************************************************************; ****Calculate sample size per group via the conditional binomial method for Matched Pairs Design****; numer = (Pconadj*(1-Pconadj))+(Ptreatadj*(1-Ptreatadj)); denom = ((Pconadj-Ptreatadj)**2)*(1-Pb); ratio = numer / denom; ncbinmatched = ((qz+Zbeta)**2)*ratio; **********************************************************************************************************; proc print noobs; var Ptime1 Ptime2 Pchange alpha power effsize Expt2con Expt2treat npgindep ncbinindep npgmatched ncbinmatched; options nodate; options nocenter; title1 'This program performs Yoo and Spoths (1993) conditional binomial method for sample size'; title2 'determination. The user enters Ptime1, Ptime2, Pchange, alpha, and power.'; title3 'Expt2con = Expected time 2 proportion for the control group. Expt2treat = Expected time 2'; title4 'proportion for the treatment group. npgindep = The sample size per group for two independent'; title5 'proportions using the arcsine transformation method. ncbinindep = The sample size per group'; title6 'for two independent proportions using the conditional binomial method. npgmatched = The sample'; title7 'size per group for two matched proportions using Miettinens method. ncbinmatched = The sample'; title8 'size per group for two matched proportions using the conditional binomial method.'; run;