* copy and paste `est_srs` and `est_strs` SAS macros into a new program editor; * then run them before using this program; data tvtime; input group $ n; do i = 1 to n; input time @@; output; end; drop i n; cards; TownA 20 35 43 36 39 28 28 29 25 38 27 26 32 29 40 35 41 37 31 45 34 TownB 8 27 15 4 41 49 25 10 30 Rural 12 8 14 12 15 30 32 21 20 34 7 11 24 ; proc print; run; proc boxplot data=tvtime; run; data stratinfo; input group $ popsize; cards; TownA 155 TownB 62 Rural 93 ; run; * calculations on page 123; %est_strs(sample=tvtime,strata=group,setup=stratinfo,param=mean,response=time,npop=popsize); * calculations on page 125; %est_strs(sample=tvtime,strata=group,setup=stratinfo,param=total,response=time,npop=popsize) ; data townb; set tvtime; if group = 'TownB'; run; * calculations on pages 123-124; %est_srs(sample=townb,npop=62,response=time,param=mean);