Supplementary material: SAS code for implementing proposed procedures
- SAS code for calculation power for person-randomized trial
/********************************************************************************
* Program Name: Fidelity power 1
* Power for tests of treatment and fidelity effects for a person-randomized trial
*
* Author Information: Lynne Stokes, Southern Methodist University
*
* Instructions on how to use this program:
* Change the information in the %LET statement for your
* particular needs.
*
* The example values here correspond to those used to produce Figure 1.
********************************************************************************/;
%LET capk = 180; /*number of intervention sessions delivered*/
%LET n = 504; /*total number of persons randomized to treatments*/
%LET icc_f = .15; /*ICC for fidelity*/
%LET alpha = .05; /*significance level of tests*/
%LET mddelta = .25; /*standardized effect size for treatment effect*/
%LET mdrho = .2; /*standardized effect size for fidelity-outcome relationship*/
data power;
/*calculate power for treatment effect and fidelity effect as function of k*/
rho_fy2=&mdrho*&mdrho;
F = finv(1-&alpha,1,&n-3,0);
do k = 1 to &capK;
kappa_k = (k*&icc_f)/(k*&icc_f+(1-&icc_f)*(1-k/&capk));
lambda_1fh = (&n*&mddelta*&mddelta)/(4*(1-kappa_k*rho_fy2/2));
powert = 1-probf(F,1,&n-3,lambda_1fh); /*power for treatment effect*/
lambda_1gp = (&n/2)*(kappa_k*rho_fy2)/(1-kappa_k*rho_fy2);
powerf = 1-probf(F,1,&n-3,lambda_1gp); /*power for fidelity*/
output;
end;
LABEL powert ="Treatment power" powerf = "Fidelity power"
kappa_k = "Reliability" k = "# sessions sampled";
DROP F rho_fy2 lambda_1fh lambda_1gp;
proc print data = power;
run;
- SAS code for calculation power for cluster-randomized trial
/****************************************************************************
* Program Name: Fidelity power 2
* Power for tests of treatment and fidelity effects for a cluster-randomized trial
*
* Author Information: Lynne Stokes, Southern Methodist University
*
* Instructions on how to use this program:
* Change the information in the %LET statement for your
* particular needs.
*
* The example values here correspond to those used to produce Figure 3.
********************************************************************************/;
%LET capk = 180; /*number of intervention sessions delivered*/
%LET J = 122; /*total number of clusters randomized to treatments*/
%LET n = 20; /*number of students per cluster*/
%LET icc_f = .15; /*ICC for fidelity*/
%LET alpha = .05; /*significance level of tests*/
%LET icc_y=.20; /*ICC for outcome*/
%LET mddelta = .25; /*standardized effect size for treatment effect*/
%LET mdrho = .35; /*standardized effect size for fidelity-outcome relationship*/
data power; /*calculate power for treatment effect and fidelity effect as function of k*/
rho_by2=&mdrho*&mdrho;
F = finv(1-&alpha,1,&J-3,0);
ificc_f = 0 then rho_by2 = 0;
do k = 1 to &capK;
kappa_k = (k*&icc_f)/(k*&icc_f+(1-&icc_f)*(1-k/&capk));
lambda_2fh = (&J*&mddelta*&mddelta)/(4*((1-kappa_k*rho_by2/2)*&icc_y+(1-&icc_y)/&n));
power2t = 1- probf(F,1,&J-3,lambda_2fh);/*power for treatment effect*/
lambda_2gp = (&J/2)*(kappa_k*rho_by2)*&icc_y/(((1-kappa_k*rho_by2)*&icc_y) +((1-&icc_y)/&n));
power2f =1-probf(F,1,&J-3,lambda_2gp);/*power for fidelity*/
output;
end;
LABEL power2t ="Treatment power" power2f = "Fidelity power"
kappa_k = "Reliability" k = "# sessions sampled";
DROP F rho_by2 lambda_2fh lambda_2gp;
procprint data = power;
run;