Changeset 21706 in main


Ignore:
Timestamp:
10/02/20 16:40:48 (4 weeks ago)
Author:
Paul Leo
Message:

Maryland BRFSS backend .sas programs.
Computing LL and UL, or lower and upper when there is no variance.
THe original versions of these programs based on NM's version, manually computed LL, UL or lower or upper.
Maryland use SAS computation of confidence intervals, and the way it computes them, when there is no variance, the confidence intervals are zero.
Now when there is no variance, the confidence intervals is the point estimate.

Location:
adopters/md/trunk/src/main/backend_qModules/brfss23
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE2CATDIST17.sas

    r21684 r21706  
    528528 
    529529  RSE=(StdErr/wgt_percent);
    530   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    531 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    532  
    533 /*      RSE=(StdErr/wgt_percent); */
    534  
     530   if RSE = . then RSE = 0; * is this reasonable?;
    535531   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    536    if RSE = . then RSE = 0; * is this reasonable?;
     532   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     533   if &varname. = '.' then delete;
    537534   
    538   if RSE >.3 then redflag=put('Unstable', $14.);
    539   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    540  
    541   if &varname. = '.' then delete;
    542  
    543   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     535   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    544536run;
    545537
     
    563555
    564556        if UL > 100 then UL = 100;
     557        /* need to compute LL and UL when there is no variance */
     558        if (wgt_percent = 0) OR (wgt_percent = 1) then
     559                do;
     560                        LL=ageadj_percent;
     561                        UL=Ageadj_percent;
     562                        RSE=0;
     563                end;
    565564
    566565   run;
     
    592591 * suppressed_variables code at the end of this file to work.              ;
    593592 **************************************************************************;
    594  
    595  
     593 title2 'TMP: rate with cell suppression';
    596594 data tmp;
    597595   set Stability;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE2CATDIST18.sas

    r21684 r21706  
    528528 
    529529  RSE=(StdErr/wgt_percent);
    530   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    531 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    532  
    533 /*      RSE=(StdErr/wgt_percent); */
    534  
     530   if RSE = . then RSE = 0; * is this reasonable?;
    535531   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    536    if RSE = . then RSE = 0; * is this reasonable?;
     532   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     533   if &varname. = '.' then delete;
    537534   
    538   if RSE >.3 then redflag=put('Unstable', $14.);
    539   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    540  
    541   if &varname. = '.' then delete;
    542  
    543   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     535   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    544536run;
    545537
     
    563555
    564556        if UL > 100 then UL = 100;
     557        /* need to compute LL and UL when there is no variance */
     558        if (wgt_percent = 0) OR (wgt_percent = 1) then
     559                do;
     560                        LL=ageadj_percent;
     561                        UL=Ageadj_percent;
     562                        RSE=0;
     563                end;
    565564
    566565   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST15.sas

    r21684 r21706  
    533533 
    534534  RSE=(StdErr/wgt_percent);
    535   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    536 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    537  
    538 /*      RSE=(StdErr/wgt_percent); */
    539  
     535   if RSE = . then RSE = 0; * is this reasonable?;
    540536   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    541    if RSE = . then RSE = 0; * is this reasonable?;
     537   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     538   if &varname. = '.' then delete;
    542539   
    543   if RSE >.3 then redflag=put('Unstable', $14.);
    544   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    545  
    546   if &varname. = '.' then delete;
    547  
    548   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     540   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    549541run;
    550542
     
    568560
    569561        if UL > 100 then UL = 100;
     562        /* need to compute LL and UL when there is no variance */
     563        if (wgt_percent = 0) OR (wgt_percent = 1) then
     564                do;
     565                        LL=ageadj_percent;
     566                        UL=Ageadj_percent;
     567                        RSE=0;
     568                end;
    570569
    571570   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST15NoVarLevel.sas

    r21684 r21706  
    463463 
    464464  RSE=(StdErr/wgt_percent);
    465   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    466 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    467 
    468  
    469 /*      RSE=(StdErr/wgt_percent); */
    470  
     465   if RSE = . then RSE = 0; * is this reasonable?;
    471466   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    472    if RSE = . then RSE = 0; * is this reasonable?;
     467   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     468   if &varname. = '.' then delete;
    473469   
    474   if RSE >.3 then redflag=put('Unstable', $14.);
    475   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    476  
    477   if &varname. = '.' then delete;
    478  
    479   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     470   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    480471run;
    481472
     
    484475        if %cross1%=-1 then %cross1%=.;
    485476        else if %cross1%='tot' then %cross1%='.';
    486         if %cross2%=-1 then %cross2%=.;
    487         else if %cross2%='tot' then %cross2%='.';
     477        ?cross2? if %cross2%=-1 then %cross2%=.;
     478        ?cross2? else if %cross2%='tot' then %cross2%='.';
    488479       
    489480
     
    499490
    500491        if UL > 100 then UL = 100;
     492        /* need to compute LL and UL when there is no variance */
     493        if (wgt_percent = 0) OR (wgt_percent = 1) then
     494                do;
     495                        LL=ageadj_percent;
     496                        UL=Ageadj_percent;
     497                        RSE=0;
     498                end;
    501499
    502500   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST16.sas

    r21684 r21706  
    533533 
    534534  RSE=(StdErr/wgt_percent);
    535   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    536 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    537  
    538 /*      RSE=(StdErr/wgt_percent); */
    539  
     535   if RSE = . then RSE = 0; * is this reasonable?;
    540536   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    541    if RSE = . then RSE = 0; * is this reasonable?;
     537   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     538   if &varname. = '.' then delete;
    542539   
    543   if RSE >.3 then redflag=put('Unstable', $14.);
    544   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    545  
    546   if &varname. = '.' then delete;
    547  
    548   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     540   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    549541run;
    550542
     
    568560
    569561        if UL > 100 then UL = 100;
     562        /* need to compute LL and UL when there is no variance */
     563        if (wgt_percent = 0) OR (wgt_percent = 1) then
     564                do;
     565                        LL=ageadj_percent;
     566                        UL=Ageadj_percent;
     567                        RSE=0;
     568                end;
    570569
    571570   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateCRC.sas

    r21684 r21706  
    527527 
    528528  RSE=(StdErr/wgt_percent);
    529   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    530 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    531  
    532 /*      RSE=(StdErr/wgt_percent); */
    533  
     529   if RSE = . then RSE = 0; * is this reasonable?;
    534530   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    535    if RSE = . then RSE = 0; * is this reasonable?;
     531   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     532   if &varname. = '.' then delete;
    536533   
    537   if RSE >.3 then redflag=put('Unstable', $14.);
    538   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    539  
    540   if &varname. = '.' then delete;
    541  
    542   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     534   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    543535run;
    544536
     
    562554
    563555        if UL > 100 then UL = 100;
     556        /* need to compute LL and UL when there is no variance */
     557        if (wgt_percent = 0) OR (wgt_percent = 1) then
     558                do;
     559                        LL=ageadj_percent;
     560                        UL=Ageadj_percent;
     561                        RSE=0;
     562                end;
    564563
    565564   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateDist8.sas

    r21684 r21706  
    532532 
    533533  RSE=(StdErr/wgt_percent);
    534   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    535 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    536  
    537 /*      RSE=(StdErr/wgt_percent); */
    538  
     534   if RSE = . then RSE = 0; * is this reasonable?;
    539535   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    540    if RSE = . then RSE = 0; * is this reasonable?;
     536   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     537   if &varname. = '.' then delete;
    541538   
    542   if RSE >.3 then redflag=put('Unstable', $14.);
    543   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    544  
    545   if &varname. = '.' then delete;
    546  
    547   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     539   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    548540run;
    549541
     
    565557
    566558/* ask Lois about the following  */
    567 
    568559        if UL > 100 then UL = 100;
     560
     561/* need to compute LL and UL when there is no variance */
     562        if (wgt_percent = 0) OR (wgt_percent = 1) then
     563                do;
     564                        LL=ageadj_percent;
     565                        UL=Ageadj_percent;
     566                        RSE=0;
     567                end;
    569568
    570569   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateDist8NoVarLevel.sas

    r21684 r21706  
    442442  merge tmp4 wgtdenom ;
    443443  by %cross1%
    444 
     444  ?cross2? %cross2%
    445445  ;
    446446  drop _TYPE_ _FREQ_ ;
     
    459459 
    460460  RSE=(StdErr/wgt_percent);
    461   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    462 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    463 
    464  
    465 /*      RSE=(StdErr/wgt_percent); */
    466  
     461   if RSE = . then RSE = 0; * is this reasonable?;
    467462   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    468    if RSE = . then RSE = 0; * is this reasonable?;
     463   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     464   if &varname. = '.' then delete;
    469465   
    470   if RSE >.3 then redflag=put('Unstable', $14.);
    471   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    472  
    473   if &varname. = '.' then delete;
    474  
    475   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     466   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    476467run;
    477468
     
    480471        if %cross1%=-1 then %cross1%=.;
    481472        else if %cross1%='tot' then %cross1%='.';
    482         if %cross2%=-1 then %cross2%=.;
    483         else if %cross2%='tot' then %cross2%='.';
     473        ?cross2? if %cross2%=-1 then %cross2%=.;
     474        ?cross2? else if %cross2%='tot' then %cross2%='.';
    484475       
    485476
     
    493484
    494485/* ask Lois about the following  */
    495 
    496486        if UL > 100 then UL = 100;
     487
     488/* need to compute LL and UL when there is no variance */
     489        if (wgt_percent = 0) OR (wgt_percent = 1) then
     490                do;
     491                        LL=ageadj_percent;
     492                        UL=Ageadj_percent;
     493                        RSE=0;
     494                end;
    497495
    498496   run;
     
    500498   proc sort data=rate;
    501499   by %cross1%
     500   ?cross2? %cross2%
    502501   ;
    503502   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRate.sas

    r21684 r21706  
    252252 */
    253253 
    254  /**** test to compare RSE and CV  - look at SAS=3 output  BUT we are not using now for stability */
     254 /**** test to compare RSE and CV  - look at SAS=3 output  BUT we are not using now for stability
    255255 
    256256 RSE=(StdErr/mean);
    257 
     257*/
    258258 
    259259  redflag=put('Stable', $14.);
    260260  if CV>.3 then redflag=put('Unstable', $14.);
    261   if Mean in (0 1) then redflag=put('No Variance', $14.);
    262 
     261
     262/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     263  if Mean in (0 1) then
     264                do;
     265                        lower=Mean;
     266                        upper =Mean;
     267                        redflag=put('No Variance', $14.);
     268                end;
    263269
    264270
     
    302308
    303309%mend;
    304 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRateMultiYR.sas

    r21684 r21706  
    273273  redflag=put('Stable', $14.);
    274274  if CV>.3 then redflag=put('Unstable', $14.);
    275   if Mean in (0 1) then redflag=put('No Variance', $14.);
    276 
     275
     276/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     277  if Mean in (0 1) then
     278                do;
     279                        lower=Mean;
     280                        upper =Mean;
     281                        redflag=put('No Variance', $14.);
     282                end;
    277283
    278284
     
    316322
    317323%mend;
    318 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRateMultiYRMultiSplitPerYear.sas

    r21684 r21706  
    273273  redflag=put('Stable', $14.);
    274274  if CV>.3 then redflag=put('Unstable', $14.);
    275   if Mean in (0 1) then redflag=put('No Variance', $14.);
    276 
     275
     276/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     277  if Mean in (0 1) then
     278                do;
     279                        lower=Mean;
     280                        upper =Mean;
     281                        redflag=put('No Variance', $14.);
     282                end;
    277283
    278284
     
    316322
    317323%mend;
    318 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRateMultiYRMultiSplitPerYear20200712.sas

    r21684 r21706  
    273273  redflag=put('Stable', $14.);
    274274  if CV>.3 then redflag=put('Unstable', $14.);
    275   if Mean in (0 1) then redflag=put('No Variance', $14.);
    276 
     275
     276/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     277  if Mean in (0 1) then
     278                do;
     279                        lower=Mean;
     280                        upper =Mean;
     281                        redflag=put('No Variance', $14.);
     282                end;
    277283
    278284
     
    316322
    317323%mend;
    318 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRateMultiYRWORKING.sas

    r21684 r21706  
    273273  redflag=put('Stable', $14.);
    274274  if CV>.3 then redflag=put('Unstable', $14.);
    275   if Mean in (0 1) then redflag=put('No Variance', $14.);
    276 
     275
     276/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     277  if Mean in (0 1) then
     278                do;
     279                        lower=Mean;
     280                        upper =Mean;
     281                        redflag=put('No Variance', $14.);
     282                end;
    277283
    278284
     
    316322
    317323%mend;
    318 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyCrudeRateNoVarLevel.sas

    r21684 r21706  
    228228  redflag=put('Stable', $14.);
    229229  if CV>.3 then redflag=put('Unstable', $14.);
    230   if Mean in (0 1) then redflag=put('No Variance', $14.);
    231230
    232231  if (%cross1%=-1) then delete; *No grand total row;
    233232 popnum=wgtdenom;
    234233  drop RSE Mean StdErr;
    235 
    236 
     234 
     235/* When No Variance, need to set lower and upper to Mean, otherwise it would be 0 */
     236  if Mean in (0 1) then
     237                do;
     238                        lower=Mean;
     239                        upper =Mean;
     240                        redflag=put('No Variance', $14.);
     241                end;
     242
     243
     244  if (%cross1%=-1) then %cross1%=.;
     245  ?cross2? if (%cross2%=-1) then %cross2%=.;
     246  popnum=wgtdenom;
     247  *drop RSE Mean StdErr Denom;
    237248
    238249  proc sort data=tmp7; by %cross1%
     250  ?cross2? %cross2%
    239251  &varname.
    240252  ;
     
    269281
    270282%mend;
    271 
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE40.sas

    r21684 r21706  
    543543 
    544544   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    545    if RSE = . then RSE = 0; * is this reasonable?;
     545   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     546   if &varname. = '.' then delete;
    546547   
    547   if RSE >.3 then redflag=put('Unstable', $14.);
    548   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    549  
    550   if &varname. = '.' then delete;
    551  
    552   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     548   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    553549run;
    554550
     
    570566
    571567/* ask Lois about the following  */
    572 
    573568        if UL > 100 then UL = 100;
     569
     570/* need to compute LL and UL when there is no variance */
     571        if (wgt_percent = 0) OR (wgt_percent = 1) then
     572                do;
     573                        LL=ageadj_percent;
     574                        UL=Ageadj_percent;
     575                        RSE=0;
     576                end;
    574577
    575578   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE40NoVarLevel.sas

    r21684 r21706  
    450450  merge tmp4 wgtdenom ;
    451451  by %cross1%
    452 
     452  ?cross2? %cross2%
    453453  ;
    454454  drop _TYPE_ _FREQ_ ;
     
    467467 
    468468  RSE=(StdErr/wgt_percent);
    469   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    470 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    471 
    472  
    473 /*      RSE=(StdErr/wgt_percent); */
    474  
     469   if RSE = . then RSE = 0; * is this reasonable?;
    475470   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    476    if RSE = . then RSE = 0; * is this reasonable?;
     471   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     472   if &varname. = '.' then delete;
    477473   
    478   if RSE >.3 then redflag=put('Unstable', $14.);
    479   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    480  
    481   if &varname. = '.' then delete;
    482  
    483   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to '.' and rounding and multiply by 100, deleting cross1 and cross2 totals';
     474   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    484475run;
    485476
     
    488479        if %cross1%=-1 then %cross1%=.;
    489480        else if %cross1%='tot' then %cross1%='.';
    490         if %cross2%=-1 then %cross2%=.;
    491         else if %cross2%='tot' then %cross2%='.';
     481        ?cross2? if %cross2%=-1 then %cross2%=.;
     482        ?cross2? else if %cross2%='tot' then %cross2%='.';
    492483       
    493484
     
    501492
    502493/* ask Lois about the following  */
    503 
    504494        if UL > 100 then UL = 100;
     495
     496/* need to compute LL and UL when there is no variance */
     497        if (wgt_percent = 0) OR (wgt_percent = 1) then
     498                do;
     499                        LL=ageadj_percent;
     500                        UL=Ageadj_percent;
     501                        RSE=0;
     502                end;
    505503
    506504   run;
     
    508506   proc sort data=rate;
    509507   by %cross1%
     508   ?cross2? %cross2%
    510509   ;
    511510   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE50.sas

    r21684 r21706  
    542542 
    543543   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    544    if RSE = . then RSE = 0; * is this reasonable?;
     544   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     545   if &varname. = '.' then delete;
    545546   
    546   if RSE >.3 then redflag=put('Unstable', $14.);
    547   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    548  
    549   if &varname. = '.' then delete;
    550  
    551   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     547   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    552548run;
    553549
     
    569565
    570566/* ask Lois about the following  */
    571 
    572567        if UL > 100 then UL = 100;
     568
     569/* need to compute LL and UL when there is no variance */
     570        if (wgt_percent = 0) OR (wgt_percent = 1) then
     571                do;
     572                        LL=ageadj_percent;
     573                        UL=Ageadj_percent;
     574                        RSE=0;
     575                end;
    573576
    574577   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE50V1.sas

    r21684 r21706  
    536536 
    537537  RSE=(StdErr/wgt_percent);
    538   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    539 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    540  
    541 /*      RSE=(StdErr/wgt_percent); */
    542  
     538   if RSE = . then RSE = 0; * is this reasonable?;
    543539   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    544    if RSE = . then RSE = 0; * is this reasonable?;
     540   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     541   if &varname. = '.' then delete;
    545542   
    546   if RSE >.3 then redflag=put('Unstable', $14.);
    547   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    548  
    549   if &varname. = '.' then delete;
    550  
    551   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     543   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    552544run;
    553545
     
    569561
    570562/* ask Lois about the following  */
    571 
    572563        if UL > 100 then UL = 100;
     564
     565/* need to compute LL and UL when there is no variance */
     566        if (wgt_percent = 0) OR (wgt_percent = 1) then
     567                do;
     568                        LL=ageadj_percent;
     569                        UL=Ageadj_percent;
     570                        RSE=0;
     571                end;
    573572
    574573   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADistMDGE45.sas

    r21684 r21706  
    533533 
    534534  RSE=(StdErr/wgt_percent);
    535   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    536 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    537  
    538 /*      RSE=(StdErr/wgt_percent); */
    539  
     535   if RSE = . then RSE = 0; * is this reasonable?;
    540536   if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    541    if RSE = . then RSE = 0; * is this reasonable?;
     537   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
     538   if &varname. = '.' then delete;
    542539   
    543   if RSE >.3 then redflag=put('Unstable', $14.);
    544   if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    545  
    546   if &varname. = '.' then delete;
    547  
    548   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
     540   proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    549541run;
    550542
     
    566558
    567559/* ask Lois about the following  */
    568 
    569560        if UL > 100 then UL = 100;
     561
     562/* need to compute LL and UL when there is no variance */
     563        if (wgt_percent = 0) OR (wgt_percent = 1) then
     564                do;
     565                        LL=ageadj_percent;
     566                        UL=Ageadj_percent;
     567                        RSE=0;
     568                end;
    570569
    571570   run;
Note: See TracChangeset for help on using the changeset viewer.