README /******************************************************************************************************************/ /* */ /* PROGRAM: OptimalDesignGEE.sas */ /* */ /* TITLE: Optimal design of longitudinal data analysis */ /* using generalized estimating equation models */ /* */ /* AUTHOR: Jingxia Liu and Graham A. Colditz */ /* */ /* For questions, comments or remarks about the code please contact Jingxia Liu (lue@wudosis.wustl.edu) */ /* */ /* DATE CREATED: Feb 20, 2016 */ /* */ /* USAGE: Optimal sample size and number of repeats measures for longitudinal studies */ /* %OD_GEE_Bin for binary outcome */ /* %OD_GEE_Cont for continuous outcome */ /* */ /* MISC: The macro requires Base SAS, SAS/IML */ /* */ /* Output variables: */ /* Rho: association parameter in working correlation matrix */ /* OptRep: number of repeats under locally optiomal design */ /* OptSamp: sample size under locally optiomal design */ /* OptPower: power under locally optiomal design */ /* */ /* 1) Rho is known */ /* 2) parameter space is given and OptSamp is within design space */ /* */ /* MaxRep: integer part of OptRep +1 */ /* MaxSamp: sample size: integer part of */ /* budget/(cost per subject enrollment+cost per repeat per subject*MaxRep) */ /* MaxBud: actual budget under the scenario of MaxRep and MaxSamp */ /* MaxPower: actual power under the scenario of MaxRep and MaxSamp */ /* MinRep: integer part of OptRep */ /* MinSamp: sample size: integer part of */ /* budget/(cost per subject enrollment+cost per repeat per subject*MinRep) */ /* MinBud: actual budget under the scenario of MinRep and MinSamp */ /* MinPower: actual power under the scenario of MinRep and MinSamp */ /* */ /* 3) parameter space is given and OptSamp is outside of design space */ /* */ /* MaxRep: integer part of (budget/MaxSamp-cost per subject enrollment) */ /* /cost per repeat per subject */ /* MaxSamp: Upper bound for cluster size */ /* MaxBud: actual budget under the scenario of MaxRep and MaxSamp */ /* MaxPower: actual power under the scenario of MaxRep and MaxSamp */ /* MinRep: integer part of (budget/MinSamp-cost per subject enrollment) */ /* /cost per repeat per subject */ /* MinSamp: Upper bound for cluster size */ /* budget/(cost per subject enrollment+cost per repeat per subject*MinRep) */ /* MinBud: actual budget under the scenario of MinRep and MinSamp */ /* MinPower: actual power under the scenario of MinRep and MinSamp */ /* */ /* ActRep: proposed number of repeats in actual world setting */ /* ActSamp: proposed sample size in actual world setting */ /* ActBud: actual budget for proposed number of repeats and sample size */ /* ActPower: actual power for proposed number of repeats and sample size */ /* */ /* Input variables for binary outcome: */ /* */ /* alpha Type I error */ /* sampsizeprop proportion of subjects assigned to the control group */ /* pcont proportion of success in control group */ /* ptrt proportion of success in treatment group */ /* costpersub cost per subject enrollment */ /* costrepeat cost per repeat per subject */ /* budget total fixed budget */ /* knownflg 1=Known rho in working correlation matrix; 0=unknown */ /* knownrho Known rho value if knownflg=1 */ /* rhoup Upper bound for rho in working correlation matrix */ /* rholow Lower bound for rho in working correlation matrix */ /* byrho, Increment between lower and uppoer bound */ /* samplow Upper bound for cluster size, only for knownflg=0 */ /* sampup Upper bound for cluster size, only for knownflg=0 */ /* */ /* Input variables for continuous outcome: */ /* */ /* alpha Type I error */ /* sampsizeprop proportion of subjects assigned to the control group */ /* pcont proportion of success in control group */ /* ptrt proportion of success in treatment group */ /* costpersub cost per subject enrollment */ /* costrepeat cost per repeat per subject */ /* budget total fixed budget */ /* knownflg 1=Known rho in working correlation matrix; 0=unknown */ /* knownrho Known rho value if knownflg=1 */ /* rhoup Upper bound for rho in working correlation matrix */ /* rholow Lower bound for rho in working correlation matrix */ /* byrho, Increment between lower and uppoer bound */ /* samplow Upper bound for cluster size, only for knownflg=0 */ /* sampup Upper bound for cluster size, only for knownflg=0 */ /* */ /* if knownflg=1 and knownrho is non-missing then output locally optimal design for knownrho */ /* if knownflg=1 and knownrho is missing then output locally optimal design */ /* for each rho in (rholow, rhoup) */ /* if knownflg=0 then */ /* parameter space (rholow, rhoup) and design space (samplow, sampup) should be non-missing */ /* output the proposed design for each rho within parameter space */ /* optimal design is the proposed design under rho=rhoup */ /* */ /******************************************************************************************************************/ To reproduce the results presented in the manuscript, Table 1: %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=50, budget=15000); %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=50, budget=20000); Table 2: %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=10, budget=15000); %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=10, budget=20000); Table 3: %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=20, budget=15000, knownflg=0, rhoup=0.35, rholow=0.05, byrho=0.05, samplow=5, sampup=100); Table 4: %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=20, budget=15000, knownflg=0, rhoup=0.35, rholow=0.05, byrho=0.05, samplow=5, sampup=50); Table 5: %OD_GEE_Bin(alpha=0.05, sampsizeprop=0.5, pcont=0.1, ptrt=0.3, costpersub=100, costrepeat=20, budget=15000, knownflg=0, rhoup=0.35, rholow=0.05, byrho=0.05, samplow=5, sampup=80);