new file. input Program. compute #n = 1. loop i = 1 to #n. leave i. end case. end loop. end file. end input program. execute. define samsize (alpha = !tokens(1) /power= !tokens(1) / delta = !tokens(1) / sigma = !tokens(1)). compute za = idf.normal((1-!alpha/2),0,1). compute zb = idf.normal(1-!power,0,1). execute. matrix. get z1/ file = *. get z2/ file = *. Print /title = " Sample Size Determination". compute za = z1(1,1). compute zb = z2(1,1). compute alpha = !alpha. compute power = !power. compute delta = !delta. compute sigma = !sigma. compute beta = 1 - power. compute p1 = 1-alpha/2. compute samlesz = trunc(((za+zb)*sigma/delta)**2 +1). print alpha /format = "f8.2" / Title = "ALPHA LEVEL". print za /format = "f8.2" / Title = "Z alpha/2". print Power /format = "f8.2" / Title = "Power LEVEL". print zb /format = "f8.2" / Title = "Z Beta". print delta /format = "f10.4" / Title = "DELTA". print sigma /format = "f10.4" / Title = "SIGMA". print samlesz /format = "f10.4" / Title = "Sample Size". end matrix. !enddefine. * Macro Call: Input alpha, power, delta and standard deviation, example;. samsize alpha =.05 power=.80 delta=2 sigma=1.