I wrote the code below for estimating sample size for a cluster randomized stepped wedge design (see https://www.jclinepi.com/article/S08...ecd1348717e510). The purpose of the code is not really important, however; what matters is that I've only just discovered that I've been running it with the local -m- undefined, and it does not give an error.
Code:
local base=.20 local int = .15 local rho=0.01 local k = 2 // # of steps local b=1 // # baseline measurements local t=1 // # measurements/step qui { foreach rho in 0 0.001 0.005 0.01 0.05 0.10 { local num = (1+`rho'*(`k'*`t'*`m'+`b'*`m'-1))*3*(1-`rho') local den= (1+`rho'*(.5*`k'*`t'*`m'+`b'*`m'-1))*2*`t'*(`k'-1/`k') local DE=`num'/`den' power twoproportions `int' `base', power(.90) local n1=round(r(N1)*2/`DE') local npersite=floor(`n1'/17) noi di `rho' _col(10) %5.3f `DE' _col(20) `n1' _col(30) `npersite' } }
What am I missing?
thanks,
Jeph
Comment