options ls=75; /* This is a program for sample sizes for a matched case-control study. Input below after cards statement. p0=Control Positivity Rate (probability control has exposure) or=Odds ratio (Relative Risk) to be detected alpha=p-value (two sided). Double it for one-sided power=Power sought for study Output: Calculates exposure probability for cases for the given odds ratio For 1,2,3,4, and 5 Controls per case, it gives sample sizes for cases, controls, and total. */ data a;input p0 or alpha power; cards; .25 1.75 .05 .8 .25 1.7 .05 .8 .25 1.5 .05 .8 .30 1.5 .05 .8 data a;set a; if alpha>1 then alpha=.01*alpha; if power>1 then power=.01*power; beta=1-power; za=probit(1-.5*alpha); zb=probit(1-beta); p1=or*p0/(1-p0+or*p0); check=p1*(1-p0)/(p0*(1-p1)); do m=1 to 5; h=(1/(p1*(1-p1)))+ (1/(M*p0*(1-p0))); n=(((za+zb)/log(or))**2)*h; n=int(1+n);ncase=m*n;total=n+ncase; output; end; data a;set a; file print; power=1-beta; k=_n_; if k=1 then do; put // @20 'Matched Case-Control Sample Size Program' // @20 'Tests are two-sided' // ; put @3 'Control' @13 'Odds' @22 'Case' @28 'Controls' @38 'P-Value' @46 'Power' @53 'Cases' @62 'Controls' @71 'Total' / @3 'Rate' @13 'Ratio' @22 'Rate' @28 'Per Case' @53 'Needed' @62 'Needed'; end; put @3 p0 @13 or @22 p1 best5. @30 m @38 alpha @46 power @53 n @62 ncase @71 total; run;