Changeset 20034 in main
 Timestamp:
 03/13/20 18:08:32 (2 weeks ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

adopters/mt/trunk/src/main/backend_qModules/birth23/test/MT_Percentage_data_frame.def
r19749 r20034 165 165 * weight as % of live births, or ratios like maternal mortality ; 166 166 * per 100 live births. ; 167 * if 20<=count <=100 (events between 20 and 100);168 * (according to Cody this does not apply for avgs??;167 * if 20<=count events= or greater than 20 ; 168 * use binomial exact confidence intervals ; 169 169 * 2. If denominater (popcount < 300) ; 170 170 * 2a. If count > 20 ; 171 171 * Report count and rates with confidence intervals ; 172 * using binomial exact confidence intervals ; 172 173 * 2b. If count < 20 ; 173 174 * Suppress rates and counts ; … … 185 186 n=count; *ibisq needs a count variable named 'n'; 186 187 rate=count/totalnum; 187 188 rateper=(rate*100); 189 188 190 if popcount>=300 then do; 189 191 … … 219 221 redflag=put('Suppressed %', $16.); 220 222 end; 221 222 if 20<=count<=100 then do; 223 * for events between 20 and 100, use Poisson to calculate confidence intervals; 224 225 rateper=(rate*100); 226 t1= GAMINV(.025,count)/totalnum*100; 227 if (t1<0) then t1=0; 228 LL=put(t1, 8.2); 229 UL=put(( GAMINV(.975,count)/totalnum*100),8.2); 230 end; 231 232 * and normal approximation for more than 100 events. ; 233 234 if count>100 then do; 235 rateper=(rate*100); 236 stderr=sqrt(rate*(1rate)/totalnum)*100; 237 t1=(rateper(1.96*stderr)); 238 if (t1<0) then t1=0; 239 LL=put(t1, 8.2); 240 UL=put((rateper+(1.96*stderr)), 8.2); 223 224 * for events >= 20 use binomial exact confidence intervals; 225 226 if count >= 20 then do; 227 diffcountL=popcountcount1; 228 diffcountU=popcountcount; 229 countplus1=count+1; 230 /************* Keeping lines for steps to obtain LL and UL ************* 231 Lowerquant=betainv(.975,diffcountL,count); 232 Upperquant=betainv(.025,diffcountU,countplus1); 233 Lowerval=(1Lowerquant)*100; 234 Upperval=(1Upperquant)*100; 235 LL=rateperLowerval; 236 UL=rateper+Upperval; 237 ***************************************************************************/ 238 LL=rateper(1(betainv(.975,diffcountL,count)))*100; 239 UL=rateper+(1(betainv(.025,diffcountU,countplus1)))*100; 241 240 LL=compress(LL); 242 241 UL=compress(UL); 243 242 redflag=put('', $15.); 244 243 end; 244 245 245 end; 246 246 … … 267 267 268 268 269 * report rate and n if popcount <300 and count >= 20 events. ; 270 271 if 20<=count<=100 then do; 272 * for events between 20 and 100, use Poisson to calculate confidence intervals; 273 274 rateper=(rate*100); 275 t1= GAMINV(.025,count)/totalnum*100; 276 if (t1<0) then t1=0; 277 LL=put(t1, 8.2); 278 UL=put(( GAMINV(.975,count)/totalnum*100),8.2); 279 end; 280 281 * and normal approximation for more than 100 events. ; 282 283 if count>100 then do; 284 rateper=(rate*100); 285 stderr=sqrt(rate*(1rate)/totalnum)*100; 286 t1=(rateper(1.96*stderr)); 287 if (t1<0) then t1=0; 288 LL=put(t1, 8.2); 289 UL=put((rateper+(1.96*stderr)), 8.2); 269 * report rate and n if popcount <300 and count >= 20 events, using binomial exact confidence intervals ; 270 271 272 if count >= 20 then do; 273 diffcountL=popcountcount1; 274 diffcountU=popcountcount; 275 countplus1=count+1; 276 /************* Keeping lines for steps to obtain LL and UL ************* 277 Lowerquant=betainv(.975,diffcountL,count); 278 Upperquant=betainv(.025,diffcountU,countplus1); 279 Lowerval=(1Lowerquant)*100; 280 Upperval=(1Upperquant)*100; 281 LL=rateperLowerval; 282 UL=rateper+Upperval; 283 ***************************************************************************/ 284 LL=rateper(1(betainv(.975,diffcountL,count)))*100; 285 UL=rateper+(1(betainv(.025,diffcountU,countplus1)))*100; 290 286 LL=compress(LL); 291 287 UL=compress(UL);
Note: See TracChangeset
for help on using the changeset viewer.