Changeset 19929 in main for adopters/mt/trunk/src/main/backend_qModules/birth23/MT_Average_data_frame.def
- Timestamp:
- 03/02/20 15:03:56 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
adopters/mt/trunk/src/main/backend_qModules/birth23/MT_Average_data_frame.def
r19751 r19929 141 141 %popcross; 142 142 proc print data=rate noobs; title2 '3. merged tmp and pop prior to cell suppression'; 143 144 ********************** 4. tmp, again ****************************; 145 * Create the output variables for the IBIS xml/map file. ; 146 * The following uses T distribution, for count, but when count ; 147 * is above 30, it is really using normal distribution ; 148 *****************************************************************; 149 data tmp; 150 set rate; 151 152 *****************************************************************; 153 * Student's t distribution. df=count-1. The "Z" value is really ; 154 * the critical value of "t", two tailed, with an alpha of 0.025. ; 155 *****************************************************************; 156 if count=1 then Z= .; 157 else if count=2 then Z= 12.706; 158 else if count=3 then Z= 4.303; 159 else if count=4 then Z= 3.182; 160 else if count=5 then Z= 2.776; 161 else if count=6 then Z= 2.571; 162 else if count=7 then Z= 2.447; 163 else if count=8 then Z= 2.365; 164 else if count=9 then Z= 2.306; 165 else if count=10 then Z= 2.262; 166 else if count=11 then Z= 2.228; 167 else if count=12 then Z= 2.201; 168 else if count=13 then Z= 2.179; 169 else if count=14 then Z= 2.160; 170 else if count=15 then Z= 2.145; 171 else if count=16 then Z= 2.131; 172 else if count=17 then Z= 2.120; 173 else if count=18 then Z= 2.110; 174 else if count=19 then Z= 2.101; 175 else if count=20 then Z= 2.093; 176 else if count=21 then Z= 2.086; 177 else if count=22 then Z= 2.074; 178 else if count=23 then Z= 2.069; 179 else if count=24 then Z= 2.064; 180 else if count=25 then Z= 2.060; 181 else if count=26 then Z= 2.056; 182 else if count=27 then Z= 2.052; 183 else if count=28 then Z= 2.048; 184 else if count=29 then Z= 2.045; 185 else if count=30 then Z= 2.042; 186 else if count>30 then Z= 1.96; 187 188 t1=mean-(Z*stderr); 189 if (t1<0) then t1=0; 190 if count in (0 1) then t1=.; 191 LL=put(t1, 8.2); 192 UL=put((mean+(z*stderr)), 8.2); 193 LL=compress(LL); 194 UL=compress(UL); 195 n=count; *ibis-q needs a count variable named 'n'; 196 197 proc print data=tmp; title2 '4. tmp again - t1=mean*stderr, LL,UL,n before suppression'; 198 run; 143 199 run; 144 200 145 ********************** 4. tmp, again Redflag and cell suppression *************;201 ********************** 5. tmp, again Redflag and cell suppression *************; 146 202 * Create the output variables for the IBIS xml/map file. ; 147 203 * Add Redflag ; … … 183 239 184 240 data tmp; 185 set rate;241 set tmp; 186 242 n=count; *ibis-q needs a count variable named 'n'; 187 243 … … 209 265 210 266 if 20<=count<=100 then do; 211 * for events between 20 and 100, use Poisson to calculate confidence intervals; 212 213 t1= GAMINV(.025,count)/popcount*1000; 214 if (t1<0) then t1=0; 215 LL=put(t1, 8.2); 216 UL=put(( GAMINV(.975,count)/popcount*1000),8.2); 267 * for events between 20 and 100, use T distribution to calculate confidence intervals; 268 * note LL and UL are calculated in step 4 above. 269 270 redflag=put('-', $15.); 271 217 272 end; 218 273 219 274 * and normal approximation for more than 100 events. ; 275 * which is also computed in step 4 above 220 276 221 277 if count>100 then do; 222 t1=(mean-(1.96*stderr)); 223 if (t1<0) then t1=0; 224 LL=put(t1, 8.2); 225 UL=put((mean+(1.96*stderr)), 8.2); 226 LL=compress(LL); 227 UL=compress(UL); 278 228 279 redflag=put('-', $15.); 229 280 end; … … 246 297 247 298 if 20<=count<=100 then do; 248 * for events between 20 and 100, use Poisson to calculate confidence intervals; 249 250 *mean=(rate*1000); 251 t1= GAMINV(.025,count)/popcount*1000; 252 if (t1<0) then t1=0; 253 LL=put(t1, 8.2); 254 UL=put(( GAMINV(.975,count)/popcount*1000),8.2); 299 * for events between 20 and 100, use T distribution to calculate confidence intervals; 300 * note LL and UL are calculated in step 4 above. 301 302 redflag=put('-', $15.); 303 255 304 end; 256 305 257 306 * and normal approximation for more than 100 events. ; 307 * which is also computed in step 4 above 258 308 259 309 if count>100 then do; 260 t1=(mean-(1.96*stderr)); 261 if (t1<0) then t1=0; 262 LL=put(t1, 8.2); 263 UL=put((mean+(1.96*stderr)), 8.2); 264 LL=compress(LL); 265 UL=compress(UL); 310 266 311 redflag=put('-', $15.); 267 312 end;
Note: See TracChangeset
for help on using the changeset viewer.