Ignore:
Timestamp:
03/03/23 07:43:59 (3 months ago)
Author:
Maria Baron
Message:

working versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • adopters/nj/trunk/src/main/ibisq/qModules3/birth/AvgGestAge.def

    r26754 r26928  
    1 f type average
    2 f variable bgestage
     1f label Average&Gestational&Age
     2f type special
     3#f xml_out_map_file XMLAverage.map
     4#f out_detail lbl_not_used__see_xml_out_map_file
    35# data_where binfdead^=2
     6f data_where bgestage<48
     7#f variable bgestage
     8
     9--------BoNdArY--------
     101 script
     11OPTIONS MPRINT MLOGIC SYMBOLGEN;
     12OPTION SPOOL;
     13
     14proc summary data=tmp;
     15  var bgestage;
     16  class %cross1%
     17  ?cross2? %cross2%
     18  ;
     19  format mean 5.2 count 9.0 sum 9.0 stderr 6.2;
     20  output out=tmp (drop=_TYPE_ _FREQ_)
     21    mean=mean n=count sum=sum stderr=stderr;
     22 run;
     23 
     24 *****************************************************************;
     25 * Student's t distribution. df=count-1. The "Z" value is really  ;
     26 * the critical value of "t", two tailed, with an alpha of 0.025. ;
     27 *****************************************************************;
     28 data tmp;
     29        set tmp;
     30       if count=1  then Z=  .;
     31  else if count=2  then Z= 12.706;
     32  else if count=3  then Z=  4.303;
     33  else if count=4  then Z=  3.182;
     34  else if count=5  then Z=  2.776;
     35  else if count=6  then Z=  2.571;
     36  else if count=7  then Z=  2.447;
     37  else if count=8  then Z=  2.365;
     38  else if count=9  then Z=  2.306;
     39  else if count=10 then Z=  2.262;
     40  else if count=11 then Z=  2.228;
     41  else if count=12 then Z=  2.201;
     42  else if count=13 then Z=  2.179;
     43  else if count=14 then Z=  2.160;
     44  else if count=15 then Z=  2.145;
     45  else if count=16 then Z=  2.131;
     46  else if count=17 then Z=  2.120;
     47  else if count=18 then Z=  2.110;
     48  else if count=19 then Z=  2.101;
     49  else if count=20 then Z=  2.093;
     50  else if count=21 then Z=  2.086;
     51  else if count=22 then Z=  2.074;
     52  else if count=23 then Z=  2.069;
     53  else if count=24 then Z=  2.064;
     54  else if count=25 then Z=  2.060;
     55  else if count=26 then Z=  2.056;
     56  else if count=27 then Z=  2.052;
     57  else if count=28 then Z=  2.048;
     58  else if count=29 then Z=  2.045;
     59  else if count=30 then Z=  2.042;
     60  else if count>30 then Z=  1.96;
     61
     62  t1=mean-(Z*stderr);
     63  if (t1<0) then t1=0;
     64  if count in (0 1) then t1=.;
     65  LL=put(t1, 8.2);
     66  UL=put((mean+(z*stderr)), 8.2);
     67  LL=compress(LL);
     68  UL=compress(UL);
     69  n=count;   *ibis-q needs a count variable named 'n';
     70  run;
     71 
     72/* data tmp;
     73  set tmp;
     74  if (0<n<20) then do;
     75   mean = .A;
     76   LL = put('**', 8.0);
     77   UL = put('**', 8.0);
     78  redflag = put('Suppressed', $12.);
     79   end;
     80   run; */
     81 proc print data=tmp noobs;  title2 '6. TMP - final dataset to pass to IBIS View app';
     82 run;
     83 
     84--------BoNdArY--------
     85f out_variable average
     86#########################################
     87# definition for output file
    488f xml_out_map_file XMLAverage.map
    5 f out_detail lbl_not_used__see_xml_out_map_file
     89 --------BoNdArY--------
     90f out_detail lbl_not_used__see_xml_out_map_file
     91  mean 15.2
     92  LL 15.2
     93  UL 15.2
     94  sum 15.0
     95  n 15.2
     96--------BoNdArY--------
     97
     98--------BoNdArY--------
     991 suppressed_variables 1
     100mean
     101--------BoNdArY--------
Note: See TracChangeset for help on using the changeset viewer.