Changeset 20026 in main


Ignore:
Timestamp:
03/13/20 09:50:45 (3 weeks ago)
Author:
Paul Leo
Message:

Montana would like to use the following for computing confidence intervals...
use binomial exact confidence limits for all of them with counts over 20 (not suppressed). The formulas for these are below, where x is the numerator (such as births with prenatal care in the first trimester), and n is the denominator (such as all births).

Lower = (1 – betainv (.975, n – x – 1, x))(100%)
Upper = (1 – betainv (.025, n – x, x + 1))(100%)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • adopters/mt/trunk/src/main/backend_qModules/birth23/MT_Average_data_frame.def

    r19929 r20026  
    264264                        end;
    265265
    266                         if 20<=count<=100 then do;
    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                        
     266                        * for events >= 20 use binomial exact confidence intervals;
     267                       
     268                        if count >= 20, then do;
     269                                LL=put(t1, 8.2);
     270                                LL=(1 – betainv (.975, popcount – count – 1, count))*100);
     271                                UL=((1 – betainv (.025, popcount – count, count + 1))*100);
     272                                LL=compress(LL);
     273                                UL=compress(UL);
    270274                                redflag=put('-', $15.);
    271 
    272                         end;
    273 
    274                         *  and normal approximation for more than 100 events. ;
    275                         * which is also computed in step 4 above
    276                        
    277                         if count>100 then do;
    278 
    279                                 redflag=put('-', $15.);
    280                         end;
     275                        end;
     276                       
    281277                end;
    282278               
     
    296292                        * report rate and n if popcount <300 and count >= 20 events.    ;
    297293
    298                         if 20<=count<=100 then do;
    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 
    304                         end;
    305 
    306                         *  and normal approximation for more than 100 events. ;
    307                         * which is also computed in step 4 above
    308                        
    309                         if count>100 then do;
    310 
     294                        * for events >= 20 use binomial exact confidence intervals;
     295                       
     296                        if count >= 20, then do;
     297                                LL=put(t1, 8.2);
     298                                LL=(1 – betainv (.975, popcount – count – 1, count))*100);
     299                                UL=((1 – betainv (.025, popcount – count, count + 1))*100);
     300                                LL=compress(LL);
     301                                UL=compress(UL);
    311302                                redflag=put('-', $15.);
    312303                        end;
Note: See TracChangeset for help on using the changeset viewer.