Changeset 21796 in main


Ignore:
Timestamp:
10/15/20 18:31:20 (11 days ago)
Author:
Paul Leo
Message:

Hawaii IBIS v2.3 BRFSS back-end .def and .sas programs
Correcting most, if not all issues with rounding and cell suppression.
Still have questions though:
1) need to verify cell suppression rules
2) need to verify Statistical Stability output rules, and possibly the data_notes section describing the Statistical Stability output rules.
3) need to get Statistical Stability column working for SurveyAARateDist9plus.sas, which could be the .def file, or the module.xml

Location:
adopters/hi/branches/2.3/src/main/backend_qModules/brfss
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/RateAADist9plus.def

    r13843 r21796  
    2020--------BoNdArY--------
    2121f out_detail lbl_not_used__see_xml_out_map_file 
    22   ageadj_percent 7.4
     22 ageadj_percent 7.4
    2323 lower 7.4
    24   upper 7.4
    25   sum 15.0
    26   wgtsum 15.0
    27   redflag 14.0
     24 upper 7.4
     25 finalsum 15.0
     26 wgtsum 15.0
     27 redflag 14.0
    2828--------BoNdArY--------
    2929--------BoNdArY--------
     
    3232lower
    3333upper
    34 sum
     34finalsum
    3535wgtsum
    3636--------BoNdArY--------
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/RateCrude.def

    r13843 r21796  
    2020--------BoNdArY--------
    2121f out_detail lbl_not_used__see_xml_out_map_file 
    22   percent 7.4
     22 percent 7.4
    2323 lower 7.4
    24   upper 7.4
    25   sum 15.0
    26   wgtsum 15.0
    27   redflag 14.0
     24 upper 7.4
     25 finalsum 15.0
     26 wgtsum 15.0
     27 redflag 14.0
    2828--------BoNdArY--------
    2929--------BoNdArY--------
     
    3232lower
    3333upper
    34 sum
     34finalsum
    3535wgtsum
    3636--------BoNdArY--------
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/RateCrudeNoVarLevel.def

    r14494 r21796  
    2121--------BoNdArY--------
    2222f out_detail lbl_not_used__see_xml_out_map_file 
    23   percent 7.4
     23 percent 7.4
    2424 lower 7.4
    25   upper 7.4
    26   sum 15.0
    27   wgtsum 15.0
    28   redflag 14.0
     25 upper 7.4
     26 finalsum 15.0
     27 wgtsum 15.0
     28 redflag 14.0
    2929--------BoNdArY--------
    3030--------BoNdArY--------
     
    3333lower
    3434upper
    35 sum
     35finalsum
    3636wgtsum
    3737--------BoNdArY--------
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/SurveyAARateDist9plus.sas

    r18423 r21796  
    55* rates. The macro variables (varname, weight) are also set in the    ;
    66* .def file. The %FocusLevel% variable is set in the IBIS Module.xml  ;
    7 * file as a filter exclude variable. This allows the user to select     ;
     7* file as a filter exclude variable. This allows the user to select   ;
    88* whether to calculate the at-risk percentage (%VarLevel=1) or the    ;
    99* not-at-risk percentage (%VarLevel=2).                               ;
     
    1313**********************************************************************;
    1414
    15 options mprint mlogic symbolgen SPOOL SOURCE2 SUMSIZE=138M pagesize=4000 linesize=150;
     15OPTIONS MPRINT MLOGIC MLOGICNEST SYMBOLGEN SPOOL SOURCE2 SUMSIZE=138M PAGESIZE=4000 LINESIZE=MAX;
    1616
    1717**********************************************************************************************;
     
    2121**********************************************************************************************;
    2222 
    23 /*proc print data=tmp (obs=10); run; */
     23/* proc print data=tmp (obs=10); run; */
     24
    2425proc freq data=tmp;
    2526   tables year / out=yrfreq noprint;
     
    5354 data tmp;
    5455     set tmpyrwgt;
    55          if %cross1% ^=Year
    56          ?cross2? and %cross2% ^=Year
     56         if upcase(%cross1%) ^=YEAR
     57         ?cross2? and %cross2% ^=YEAR
    5758         then
    5859     _llcpwt=_llcpwt/nyears;
     
    291292
    292293***** SAMPLEN ****************************************************************;
    293 * GENERATE UNWEIGHTED SAMPLEN FOR CROSS1, CROSS2 for cell suppression below    ;
     294* GENERATE UNWEIGHTED SAMPLEN FOR CROSS1, CROSS2 for cell suppression below   ;
    294295******************************************************************************;
    295296 title2 'SAMPLEN: the n from all the varname totals';
     
    375376  if .50<=wgt_percent<1 then RSE=(StdErr/(1-wgt_percent));
    376377 
    377   redflag=put('Stable', $14.);
    378   if rse>.3 then redflag=put('Unstable', $14.);
    379   if rse>.5 then redflag=put('Very Unstable', $14.);
    380   if SampleN in (0 1) then redflag=put('No Variance', $14.);
     378 /**********************************************************************************************************
     379  * Not sure we are using this, just commenting out, and keeping it here;
     380  *   If we do use this we will have to change logic way below where we Convert values for cell suppression;
     381  *if rse>.3 then redflag=put('Unstable', $14.);
     382  *if rse>.5 then redflag=put('Very Unstable', $14.);
     383  ***********************************************************************************************************/
     384  /* may want to comment this out at some future date */
     385  if wgt_percent in (0 1) then redflag=put('No Variance', $14.);
     386 
    381387        if %cross1%=-1 then %cross1%=.;
    382388        else if %cross1%='tot' then %cross1%='.';
     
    384390        ?cross2? else if %cross2%='tot' then %cross2%='.';
    385391       
    386 
    387   /* Since these are esimates HI wants to round to 100's and sum is numerator */
    388   sum=ROUND(sum,100);
    389   /* original wgtsum=ROUND(wgtsum,100); */
    390   /* prevents wgtsum from being 0, we'll round up */
    391   If 0<wgtsum<50 then wgtsum=50;
    392          else if wgtsum >= 50 then
     392  /* Since these are esimates HI wants to round to 100's and sum is weighted numerator */
     393 
     394   finalsum=ROUND(sum,100);
     395   
     396   /* had this as  If 0<sum<50 then finalsum=50;, but in reading emails from around 3/18/2019
     397    Katherine want this to be if weighted count is less than 50 show 50, because even if no one
     398        responded yes to th e particular indicator question, that does not mean no one in population, just sample
     399  */
     400    If sum<50 then finalsum=50;
     401   
    393402  wgtsum=ROUND(wgtsum,100);
    394 
    395403   ageadj_percent=100*wgt_percent;
    396404   lower=100*lower;
     
    419427 title2 'TMP: rate with cell suppression';
    420428 data tmp;
    421    set rse;
    422    if &varname = '%spvar2%'; /*This is the value for the indicator dimension passed in by the URL.;*/
    423 if (0<SampleN<50) OR  (rse >.3) then do;
    424      ageadj_percent = .A;
    425      lower = .A;
    426      upper = .A;
    427         sum = .A;
    428         wgtsum = .A;
    429         redflag=put('Not Reportable', $14.);
    430    end;
    431    proc print data=tmp noobs;  title2 'final tmp'; run;
     429        set rse;
     430        if &varname = '%spvar2%'; /*This is the value for the indicator dimension passed in by the URL.;*/
     431        if (0<SampleN<50) OR  (rse >.3) then do;        /* Hawaii cell supression Rule */
     432       
     433                ageadj_percent = .A;    * Age-adjustedpercent who answered yes or no;
     434                lower = .A;                             * lower confidence interval;
     435                upper = .A;                             * upper confidence interval;
     436                finalsum = .A;                  * pop estimated weighted numerator;
     437                wgtsum = .A;                    * pop estimated weighted denominator;
     438                redflag=put('Not Reportable', $14.);
     439        end;
     440        proc print data=tmp noobs;  title2 'final tmp'; run;
    432441
    433442%mend;
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/SurveyCrudeRate.sas

    r13843 r21796  
    55* rates. The macro variables (varname, weight) are also set in the    ;
    66* .def file. The %FocusLevel% variable is set in the IBIS Module.xml  ;
    7 * file as a filter exclude variable. This allows the user to select     ;
     7* file as a filter exclude variable. This allows the user to select   ;
    88* whether to calculate the at-risk percentage (%VarLevel=1) or the    ;
    99* not-at-risk percentage (%VarLevel=2).                               ;
     
    1313**********************************************************************;
    1414
    15 OPTIONS MPRINT MLOGIC MLOGICNEST SYMBOLGEN SPOOL SOURCE2 SUMSIZE=138M PAGESIZE=4000 LINESIZE=150;
     15OPTIONS MPRINT MLOGIC MLOGICNEST SYMBOLGEN SPOOL SOURCE2 SUMSIZE=138M PAGESIZE=4000 LINESIZE=MAX;
    1616
    1717**********************************************************************************************;
     
    2222 
    2323/* proc print data=tmp (obs=10); run; */
     24
    2425proc freq data=tmp;
    2526   tables year / out=yrfreq noprint;
     
    5354 data tmp;
    5455     set tmpyrwgt;
    55          if %cross1% ^=Year
    56          ?cross2? and %cross2% ^=Year
     56         if upcase(%cross1%) ^=YEAR
     57         ?cross2? and upcase(%cross2%) ^=YEAR
    5758         then
    5859     _llcpwt=_llcpwt/nyears;
     
    9798********* tmp1: Grab stats for dimension totals *****************;
    9899*********(NOT SURE WE NEED THIS FOR CRUDE RATES)*****************;
     100*****************************************************************;
    99101proc print data=stats; title1 ' '; title2 'stats';
    100102
     
    119121  &varname.=input(VarLevel, $54.);
    120122  drop LowerCLMean UpperCLMean VarLevel DomainLabel VarLabel VarName StdDev;
    121   %if '%cross1%' != 'Year' %then %do;
    122         if year_sflag<=0 then delete;
     123/* this code has never worked, originally there was a ! (logical OR) operator instead of the ^=
     124so the test was never true, fixed code to make test work, but that actually broke the output
     125since it has never worked, am commenting it out 
     126  %if %UPCASE(%cross1%) ^= YEAR %then %do;
     127    if year_sflag<=0  then delete;
    123128  %end;
     129*/
    124130  proc print; title2 'tmp2: Grab %, SE, codes for indicator variable';
    125131run;
    126132
    127 **********************************************************;
    128 ********** tmp3: Grab sample size (denominator) **********;
    129 **********************************************************;
     133****************************************************************;
     134********** tmp3: Grab sample size (denominator) ****************;
     135*** N (sas var), ouput in domain dataset by proc surveymeans ***;
     136*** is number of records with valid data for varname          **;
     137****************************************************************;
    130138proc summary data=tmp2;
    131139  var N;
     
    137145  proc sort data=SampleN; by %cross1%
    138146  ?cross2? %cross2%
    139   ;
     147  ;                     * sum(N)=, sum the values of N across all combinations of cross1, cross2 and varname;
     148                        *         gets subtotals by each class var, and a grand total across all values of all class variables;
    140149  proc print; title2 'sampleN - (Unweighted number of folks who answered either y or n) Number of Records for cell suppression';
    141150  run;
     
    144153  set sampleN;
    145154  if &varname. ='';
    146   sampleN=N;
     155    sampleN=N;
    147156  /*vtypetst=vtype(%cross1%);*/
    148157  drop  _TYPE_ _FREQ_ ;
     
    161170********** tmp4: Calculate asymmetric confidence ints ***********;
    162171*****************************************************************;
    163 data tmp2;
    164         set tmp2;
    165 run;
    166172data tmp4;
    167173  set tmp2 tmp1;
     
    183189********* tmp5: Add sample size field to every record ************;
    184190********* this is only for cell suppression           ************;
     191******  N in output is unweighted numerator               ********;
     192****  Samplen in output is the unweighted denominator        *****;
    185193******************************************************************;
    186194
     
    190198  ?cross2? %cross2%
    191199  ;
    192   proc print; title2 'tmp5: Add sample size field to every record';
    193 run;
    194 
    195 *****************************************************************;
    196 ********** tmp6: Add wgtsum field to every record ***************;
    197 ***********Used by Hawaii, they want estimated ******************;
    198 *number in pop having that category/repsonse, not samplen********;
    199 *********** (May need debugging... ??) **************************;
    200 *****************************************************************;
     200  proc print; title2 'tmp5: Add sample size (Samplen) field to every record';
     201run;
     202
     203******************************************************************;
     204********** tmp6: Add wgtsum field to every record ****************;
     205***********Used by Hawaii, they want estimated number in *********;
     206***   pop having that category/repsonse, not unweighted samplen **;
     207******************************************************************;
    201208proc summary data=tmp5;
    202   var Sum;
     209  var sum;
    203210  class %cross1%
    204211  ?cross2? %cross2%
    205212  &varname.
    206213  ;
    207   output out=weightedN sum(Sum)=wgtsum;
    208   proc sort data=weightedN; by %cross1%
    209   ?cross2? %cross2%
    210   ;
    211   proc print; title2 'weightedN - estimated population category in that category or response';
     214  output out=wgtsum sum(sum)=wgtsum;
     215  proc sort data=wgtsum; by %cross1%
     216  ?cross2? %cross2%
     217  ;
     218  proc print; title2 'wgtsum - estimated population category in that category or response';
    212219  run;
    213   data wgtsum;
    214         set weightedN;
    215         if &varname ='';
    216   proc print; title2 'wgtsum: Total rows of weighted N - estimated number in that category or response';
     220  data wgtdata;
     221        set wgtsum;
     222         if &varname ='';
     223  proc print; title2 'wgtdata: Total rows of wgtsum dataset - estimated number in that category or response';
    217224        run;
    218225       
     
    222229        ;
    223230        run;
    224   proc sort data=wgtsum;
     231  proc sort data=wgtdata;
    225232        by %cross1%
    226233        ?cross2? %cross2%
     
    228235        run;
    229236
    230 data tmp6; *Add weightedN (wgtsum) field to each record;
    231   merge wgtsum tmp5 ;
     237data tmp6; *Add wgtsum field (pop estimates) to each record by merging wgtdata and tmp5;
     238  merge wgtdata tmp5 ;
    232239  by %cross1%
    233240  ?cross2? %cross2%
    234241  ;
    235242  drop _TYPE_ _FREQ_ ;
    236   proc print; title2 'tmp6: Add weighted sample (wgtsum) field to every record';
     243  proc print; title2 'tmp6: Add wgtsum field (pop estimates) to each record by merging wgtdata and tmp5';
    237244run;
    238245
     
    252259 
    253260  redflag=put('Stable', $14.);
    254   if rse>.3 then redflag=put('Unstable', $14.);
    255   if rse>.5 then redflag=put('Very Unstable', $14.);
    256   if SampleN in (0 1) then redflag=put('No Variance', $14.);
     261 /**********************************************************************************************************
     262  * Not sure we are using this, just commenting out, and keeping it here;
     263  *   If we do use this we will have to change logic way below where we Convert values for cell suppression;
     264  *if rse>.3 then redflag=put('Unstable', $14.);
     265  *if rse>.5 then redflag=put('Very Unstable', $14.);
     266  ***********************************************************************************************************/
     267  /* may want to comment this out at some future date */
     268  if mean in (0 1) then redflag=put('No Variance', $14.);
    257269
    258270  if trow1=1 then %cross1%='.';
    259271  ?cross2? if trow2=1 then %cross2%='.';
    260272
    261   /* Since these are esimates HI wants to round to 100's and sum is numerator */
    262    sum=ROUND(sum,100);
    263   /* original wgtsum=ROUND(wgtsum,100); */
    264   /* prevents wgtsum from being 0, we'll round up */
    265   If 0<wgtsum<50 then wgtsum=50;
    266          else if wgtsum >= 50 then
     273  /* Since these are esimates HI wants to round to 100's and sum is weighted numerator */
     274 
     275   finalsum=ROUND(sum,100);
     276   
     277   /* had this as  If 0<sum<50 then finalsum=50;, but in reading emails from around 3/18/2019
     278    Katherine want this to be if weighted count is less than 50 show 50, because even if no one
     279        responded yes to th e particular indicator question, that does not mean no one in population, just sample
     280  */
     281    If sum<50 then finalsum=50;
     282   
    267283  wgtsum=ROUND(wgtsum,100);
    268284
     
    274290  run;
    275291
    276 proc print data=tmp7; title2 'tmp7: Calc RSE, Add redflag to dataset, Set total rows to ., round num and denom';
     292proc print data=tmp7; title2 'tmp7: Compute RSE, Add redflag to dataset, delete Unknowns, Set total rows to ., remove other total rows, round num and denom';
    277293run;
    278294
     
    285301  if (SampleN<50) OR  (rse >.3) then do;        /* Hawaii cell supression Rule */
    286302
    287         percent = .A;
    288         lower = .A;
    289         upper = .A;
    290         sum = .A;
    291         wgtsum = .A;
     303        percent = .A;   * percent who answered yes or no;
     304        lower = .A;             * lower confidence interval;
     305        upper = .A;             * upper confidence interval;
     306        finalsum = .A;  * pop estimated weighted numerator;
     307        wgtsum = .A;    * pop estimated weighted denominator;
    292308        redflag=put('Not Reportable', $14.);
    293309  end;
  • adopters/hi/branches/2.3/src/main/backend_qModules/brfss/SurveyCrudeRateNoVarLevel.sas

    r13843 r21796  
    77* than 2 response categories. The varname passed in becomes            ;
    88* becomes &varname analyzed by proc surveymeans                        ;
     9*                                                                      ;
    910* Missing set to . for all indicator and dimension vars                ;
    1011*                                                                      ;
    1112***********************************************************************;
    12 */
    13 
    14 OPTIONS MPRINT MLOGIC MLOGICNEST SYMBOLGEN SPOOL SOURCE2 SUMSIZE=138M PAGESIZE=4000;
    15 
     13
     14OPTIONS MPRINT MLOGIC MLOGICNEST SYMBOLGEN SPOOL SOURCE2 SUMSIZE=138M PAGESIZE=4000 LINESIZE=MAX;
    1615
    1716**********************************************************************************************;
     
    2120**********************************************************************************************;
    2221 
    23 /*proc print data=tmp (obs=10); run; */
     22/* proc print data=tmp (obs=10); run; */
     23
    2424proc freq data=tmp;
    2525   tables year / out=yrfreq noprint;
     
    5353 data tmp;
    5454     set tmpyrwgt;
    55          if %cross1% ^=Year
    56          ?cross2? and %cross2% ^=Year
     55         if upcase(%cross1%) ^=YEAR
     56         ?cross2? and upcase(%cross2%) ^=YEAR
    5757         then
    5858     _llcpwt=_llcpwt/nyears;
     
    8383********* tmp1: Grab stats for dimension totals *****************;
    8484*********(NOT SURE WE NEED THIS FOR CRUDE RATES)*****************;
     85*****************************************************************;
    8586proc print data=stats; title1 ' '; title2 'stats';
    8687
     
    9091  trow1 = 1;
    9192  ?cross2? trow2 = 1;
    92   drop VarName VarLabel StdDev;
     93  drop VarLevel VarName VarLabel StdDev;
    9394  proc print;
    9495        title1 '===================================================================';
     
    103104data tmp2;
    104105  set domain;
    105  
    106106  &varname.=input(VarLevel, $54.);
    107  
    108   drop LowerCLMean UpperCLMean DomainLabel VarLabel VarName StdDev;
    109 
    110   %if '%cross1%' != 'Year' %then %do;
    111         if year_sflag<=0 then delete;
     107  drop LowerCLMean UpperCLMean VarLevel DomainLabel VarLabel VarName StdDev;
     108/* this code has never worked, originally there was a ! (logical OR) operator instead of the ^=
     109so the test was never true, fixed code to make test work, but that actually broke the output
     110since it has never worked, am commenting it out 
     111  %if %UPCASE(%cross1%) ^= YEAR %then %do;
     112    if year_sflag<=0  then delete;
    112113  %end;
    113 
     114*/
    114115  proc print; title2 'tmp2: Grab %, SE, codes for indicator variable';
    115116run;
    116117
    117 **********************************************************;
    118 ********** tmp3: Grab sample size (denominator) **********;
    119 **********************************************************;
     118****************************************************************;
     119********** tmp3: Grab sample size (denominator) ****************;
     120*** N (sas var), ouput in domain dataset by proc surveymeans ***;
     121*** is number of records with valid data for varname          **;
     122****************************************************************;
    120123proc summary data=tmp2;
    121124  var N;
     
    127130  proc sort data=SampleN; by %cross1%
    128131  ?cross2? %cross2%
    129   ;
    130   proc print; title2 'sampleN - Number of Records for cell suppression';
     132  ;                     * sum(N)=, sum the values of N across all combinations of cross1, cross2 and varname;
     133                        *         gets subtotals by each class var, and a grand total across all values of all class variables;
     134  proc print; title2 'sampleN - (Unweighted number of folks who answered either y or n) Number of Records for cell suppression';
    131135  run;
    132136data tmp3;
    133137  format trow1 trow2 1.0;
    134138  set sampleN;
    135     if &varname. =''; 
    136   sampleN=N;
     139  if &varname. ='';
     140    sampleN=N;
    137141  /*vtypetst=vtype(%cross1%);*/
    138142  drop  _TYPE_ _FREQ_ ;
     
    156160*****************************************************************;
    157161data tmp4;
    158   set tmp2;
     162  set tmp2 tmp1;
    159163  f=log(mean)-log(1-mean); 
    160164  s=stderr/(mean*(1-mean));
     
    174178********* tmp5: Add sample size field to every record ************;
    175179********* this is only for cell suppression           ************;
     180******  N in output is unweighted numerator               ********;
     181****  Samplen in output is the unweighted denominator        *****;
    176182******************************************************************;
    177183
     
    180186  by %cross1%
    181187  ;
    182   proc print; title2 'tmp5: Add SampleN to every record';
    183 run;
    184 
    185 *****************************************************************;
    186 ********** tmp6: Add wgtsum field to every record ************;
    187 ***********Used by Hawaii, they want pop num, not samplen********;
    188 *****************************************************************;
     188  proc print; title2 'tmp5: Add sample size (Samplen) field to every record';
     189run;
     190
     191******************************************************************;
     192********** tmp6: Add wgtsum field to every record ****************;
     193***********Used by Hawaii, they want estimated number in *********;
     194***   pop having that category/repsonse, not unweighted samplen **;
     195******************************************************************;
    189196proc summary data=tmp5;
    190197  var sum;
     
    196203  proc sort data=wgtsum; by %cross1%
    197204  ;
    198   proc print; title2 'wgtsum';
     205  proc print; title2 'wgtsum - estimated population category in that category or response';
    199206  run;
    200207  data wgtdata;
    201208        set wgtsum;
    202209         if &varname ='';
    203   proc print; title2 'wgtdata: Total rows of sum';
     210  proc print; title2 'wgtdata: Total rows of wgtsum dataset - estimated number in that category or response';
    204211        run;
    205212       
     
    214221        run;
    215222
    216 data tmp6; *Add wgtsum field to each record;
     223data tmp6; *Add wgtsum field (pop estimates) to each record by merging wgtdata and tmp5;
    217224  merge wgtdata tmp5 ;
    218225  by %cross1%
    219226  ;
    220227  drop _TYPE_ _FREQ_ ;
    221   proc print; title2 'tmp6: Add wgtsum field to every record';
     228  proc print; title2 'tmp6: Add wgtsum field (pop estimates) to each record by merging wgtdata and tmp5';
    222229run;
    223230
     
    235242  if 0<mean<.50 then RSE=(StdErr/mean);
    236243  if .50<=mean<1 then RSE=(StdErr/(1-mean));
    237 
     244 
    238245  redflag=put('Stable', $14.);
    239   if rse>.3 then redflag=put('Unstable', $14.);
    240   if rse>.5 then redflag=put('Very Unstable', $14.);
    241   if sum=1 then redflag=put('No Variance', $14.);
     246 /**********************************************************************************************************
     247  * Not sure we are using this, just commenting out, and keeping it here;
     248  *   If we do use this we will have to change logic way below where we Convert values for cell suppression;
     249  *if rse>.3 then redflag=put('Unstable', $14.);
     250  *if rse>.5 then redflag=put('Very Unstable', $14.);
     251  ***********************************************************************************************************/
     252  /* may want to comment this out at some future date */
     253  if mean in (0 1) then redflag=put('No Variance', $14.);
    242254
    243255  if trow1=1 and trow2=1 then delete; /* get rid of total */
    244  
    245   /* Since these are esimates HI wants to round to 100's and sum is numerator */
    246   sum=ROUND(sum,100);
    247   If 0<wgtsum<50 then wgtsum=50;
    248          else if wgtsum >= 50 then
     256
     257  /* Since these are esimates HI wants to round to 100's and sum is weighted numerator */
     258 
     259   finalsum=ROUND(sum,100);
     260   
     261   /* had this as  If 0<sum<50 then finalsum=50;, but in reading emails from around 3/18/2019
     262    Katherine want this to be if weighted count is less than 50 show 50, because even if no one
     263        responded yes to th e particular indicator question, that does not mean no one in population, just sample
     264  */
     265    If sum<50 then finalsum=50;
     266   
    249267  wgtsum=ROUND(wgtsum,100);
    250  
    251   proc sort data=tmp7; by %cross1% &varname.
     268
     269 
     270  proc sort data=tmp7; by %cross1%
     271  ?cross2? %cross2%
     272  &varname.
    252273  ;
    253274  run;
     
    263284 
    264285  if (SampleN<50) OR  (rse >.3) then do;        /* Hawaii cell supression Rule */
    265         percent = .A;
    266         lower = .A;
    267         upper = .A;
    268         sum = .A;
    269         wgtsum = .A;
     286
     287        percent = .A;   * percent who answered yes or no;
     288        lower = .A;             * lower confidence interval;
     289        upper = .A;             * upper confidence interval;
     290        finalsum = .A;  * pop estimated weighted numerator;
     291        wgtsum = .A;    * pop estimated weighted denominator;
    270292        redflag=put('Not Reportable', $14.);
    271293  end;
Note: See TracChangeset for help on using the changeset viewer.