Changeset 21711 in main


Ignore:
Timestamp:
10/03/20 10:59:14 (3 weeks ago)
Author:
Paul Leo
Message:

Maryland BRFSS backend .sas programs.
Age Adjusted programs - clean up
There were some calculations repeated, removed some commented out pieces that are now not used

Location:
adopters/md/trunk/src/main/backend_qModules/brfss23
Files:
1 added
12 edited

Legend:

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

    r21710 r21711  
    396396*********/
    397397
    398 
    399         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    400         /* commenting out, not sure if I need to do theis
    401         if (wgt_percent<=0) then do;
    402                 wgt_percent=0;
    403                 wgt_percent=0;
    404                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    405                 stderr=0;
    406                 LL=put(0, 7.1);
    407                 UL=put(0, 7.1);
    408         end;
    409         */
    410         /* if (0<wgt_percent<1) then do;  */
    411                 stderr=sqrt(wgt_var);
    412                 t1=(wgt_percent-(1.96*stderr));
    413                 if (t1<0) then t1=0;
    414                         LL=t1;
    415                         UL=(wgt_percent+(1.96*stderr));
    416                 if UL > 100 then UL = 100;
    417         /*  end;  */
    418        
    419         if (wgt_percent=1) then do;
    420                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    421                 stderr=0;
    422                 LL=put(0, 7.1);
    423                 UL=put(0, 7.1);
    424         end;
    425        
     398        stderr=sqrt(wgt_var);
     399        t1=(wgt_percent-(1.96*stderr));
     400        if (t1<0) then t1=0;
     401                LL=t1;
     402                UL=(wgt_percent+(1.96*stderr));
     403        if UL > 100 then UL = 100;
     404
    426405        LL=compress(LL);
    427406        UL=compress(UL);
     
    523502**************************************************************************;
    524503data Stability;
    525    set tmp6;
    526    
     504        set tmp6;
     505       
     506        if &varname. = '.' then delete;
    527507        redflag=put('Stable', $14.);
    528  
    529   RSE=(StdErr/wgt_percent);
    530    *if RSE = . then RSE = 0; * is this reasonable?;
    531    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    532    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    533    if &varname. = '.' then delete;
    534    
    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';
     508       
     509        RSE=(StdErr/wgt_percent);
     510
     511        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    536512run;
    537513
     
    553529
    554530/* ask Lois about the following  */
    555 
    556531        if UL > 100 then UL = 100;
    557         /* need to compute LL and UL when there is no variance */
     532
     533/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    558534        if (wgt_percent = 0) OR (wgt_percent = 1) then
    559535                do;
     
    561537                        UL=Ageadj_percent;
    562538                        RSE=0;
     539                        redflag=put('No Variance', $14.);
    563540                end;
    564541
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE2CATDIST18.sas

    r21710 r21711  
    396396*********/
    397397
    398 
    399         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    400         /* commenting out, not sure if I need to do theis
    401         if (wgt_percent<=0) then do;
    402                 wgt_percent=0;
    403                 wgt_percent=0;
    404                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    405                 stderr=0;
    406                 LL=put(0, 7.1);
    407                 UL=put(0, 7.1);
    408         end;
    409         */
    410         /* if (0<wgt_percent<1) then do;  */
    411                 stderr=sqrt(wgt_var);
    412                 t1=(wgt_percent-(1.96*stderr));
    413                 if (t1<0) then t1=0;
    414                         LL=t1;
    415                         UL=(wgt_percent+(1.96*stderr));
    416                 if UL > 100 then UL = 100;
    417         /*  end;  */
    418        
    419         if (wgt_percent=1) then do;
    420                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    421                 stderr=0;
    422                 LL=put(0, 7.1);
    423                 UL=put(0, 7.1);
    424         end;
    425        
     398        stderr=sqrt(wgt_var);
     399        t1=(wgt_percent-(1.96*stderr));
     400        if (t1<0) then t1=0;
     401                LL=t1;
     402                UL=(wgt_percent+(1.96*stderr));
     403        if UL > 100 then UL = 100;
     404
    426405        LL=compress(LL);
    427406        UL=compress(UL);
     
    523502**************************************************************************;
    524503data Stability;
    525    set tmp6;
    526    
     504        set tmp6;
     505       
     506        if &varname. = '.' then delete;
    527507        redflag=put('Stable', $14.);
    528  
    529   RSE=(StdErr/wgt_percent);
    530    *if RSE = . then RSE = 0; * is this reasonable?;
    531    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    532    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    533    if &varname. = '.' then delete;
    534    
    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';
     508       
     509        RSE=(StdErr/wgt_percent);
     510
     511        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    536512run;
    537513
     
    553529
    554530/* ask Lois about the following  */
    555 
    556531        if UL > 100 then UL = 100;
    557         /* need to compute LL and UL when there is no variance */
     532
     533/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    558534        if (wgt_percent = 0) OR (wgt_percent = 1) then
    559535                do;
     
    561537                        UL=Ageadj_percent;
    562538                        RSE=0;
     539                        redflag=put('No Variance', $14.);
    563540                end;
    564541
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST15.sas

    r21710 r21711  
    401401*********/
    402402
    403 
    404         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    405         /* commenting out, not sure if I need to do theis
    406         if (wgt_percent<=0) then do;
    407                 wgt_percent=0;
    408                 wgt_percent=0;
    409                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    410                 stderr=0;
    411                 LL=put(0, 7.1);
    412                 UL=put(0, 7.1);
    413         end;
    414         */
    415         /* if (0<wgt_percent<1) then do;  */
    416                 stderr=sqrt(wgt_var);
    417                 t1=(wgt_percent-(1.96*stderr));
    418                 if (t1<0) then t1=0;
    419                         LL=t1;
    420                         UL=(wgt_percent+(1.96*stderr));
    421                 if UL > 100 then UL = 100;
    422         /*  end;  */
    423        
    424         if (wgt_percent=1) then do;
    425                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    426                 stderr=0;
    427                 LL=put(0, 7.1);
    428                 UL=put(0, 7.1);
    429         end;
    430        
     403        stderr=sqrt(wgt_var);
     404        t1=(wgt_percent-(1.96*stderr));
     405        if (t1<0) then t1=0;
     406                LL=t1;
     407                UL=(wgt_percent+(1.96*stderr));
     408        if UL > 100 then UL = 100;
     409
    431410        LL=compress(LL);
    432411        UL=compress(UL);
     
    528507**************************************************************************;
    529508data Stability;
    530    set tmp6;
    531    
     509        set tmp6;
     510       
     511        if &varname. = '.' then delete;
    532512        redflag=put('Stable', $14.);
    533  
    534   RSE=(StdErr/wgt_percent);
    535    *if RSE = . then RSE = 0; * is this reasonable?;
    536    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    537    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    538    if &varname. = '.' then delete;
    539    
    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';
     513       
     514        RSE=(StdErr/wgt_percent);
     515
     516        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    541517run;
    542518
     
    558534
    559535/* ask Lois about the following  */
    560 
    561536        if UL > 100 then UL = 100;
    562         /* need to compute LL and UL when there is no variance */
     537
     538/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    563539        if (wgt_percent = 0) OR (wgt_percent = 1) then
    564540                do;
     
    566542                        UL=Ageadj_percent;
    567543                        RSE=0;
     544                        redflag=put('No Variance', $14.);
    568545                end;
    569546
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST15NoVarLevel.sas

    r21710 r21711  
    323323
    324324/**********
    325         OLD Asymmetirec?
     325        OLD Asymmetric?
    326326                 f=log(wgt_percent)-log(1-wgt_percent); 
    327327                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    334334*********/
    335335
    336 
    337         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    338         /* commenting out, not sure if I need to do theis
    339         if (wgt_percent<=0) then do;
    340                 wgt_percent=0;
    341                 wgt_percent=0;
    342                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    343                 stderr=0;
    344                 LL=put(0, 7.1);
    345                 UL=put(0, 7.1);
    346         end;
    347         */
    348         /* if (0<wgt_percent<1) then do;  */
    349                 stderr=sqrt(wgt_var);
    350                 t1=(wgt_percent-(1.96*stderr));
    351                 if (t1<0) then t1=0;
    352                         LL=t1;
    353                         UL=(wgt_percent+(1.96*stderr));
    354                 if UL > 100 then UL = 100;
    355         /*  end;  */
    356        
    357         if (wgt_percent=1) then do;
    358                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    359                 stderr=0;
    360                 LL=put(0, 7.1);
    361                 UL=put(0, 7.1);
    362         end;
    363        
     336        stderr=sqrt(wgt_var);
     337        t1=(wgt_percent-(1.96*stderr));
     338        if (t1<0) then t1=0;
     339                LL=t1;
     340                UL=(wgt_percent+(1.96*stderr));
     341        if UL > 100 then UL = 100;
     342
    364343        LL=compress(LL);
    365344        UL=compress(UL);
     
    374353  proc sort data=rate;
    375354   by %cross1%
    376     
     355   ?cross2? %cross2%
    377356   &varname.;
    378357   run;
     
    386365 proc summary data=tmpall nway;
    387366   var N;
    388    class %cross1% ;
     367   class %cross1% %cross2%;
    389368   output out=sampleN sum(N)=sampleN;
    390369   run;
    391370 proc sort data=sampleN;
    392371   by %cross1% 
    393 
     372   ?cross2? %cross2%
    394373   ;
    395374
     
    458437**************************************************************************;
    459438data Stability;
    460    set tmp6;
    461    
     439        set tmp6;
     440       
     441        if &varname. = '.' then delete;
    462442        redflag=put('Stable', $14.);
    463  
    464   RSE=(StdErr/wgt_percent);
    465    *if RSE = . then RSE = 0; * is this reasonable?;
    466    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    467    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    468    if &varname. = '.' then delete;
    469    
    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';
     443       
     444        RSE=(StdErr/wgt_percent);
     445
     446        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    471447run;
    472448
     
    488464
    489465/* ask Lois about the following  */
    490 
    491466        if UL > 100 then UL = 100;
    492         /* need to compute LL and UL when there is no variance */
     467
     468/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    493469        if (wgt_percent = 0) OR (wgt_percent = 1) then
    494470                do;
     
    496472                        UL=Ageadj_percent;
    497473                        RSE=0;
     474                        redflag=put('No Variance', $14.);
    498475                end;
    499476
     
    502479   proc sort data=rate;
    503480   by %cross1%
     481   ?cross2? %cross2%
    504482   ;
    505483   run;
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateAGE3CATDIST16.sas

    r21710 r21711  
    390390
    391391/**********
    392         OLD Asymmetirec?
     392        OLD Asymmetric?
    393393                 f=log(wgt_percent)-log(1-wgt_percent); 
    394394                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    401401*********/
    402402
    403 
    404         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    405         /* commenting out, not sure if I need to do theis
    406         if (wgt_percent<=0) then do;
    407                 wgt_percent=0;
    408                 wgt_percent=0;
    409                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    410                 stderr=0;
    411                 LL=put(0, 7.1);
    412                 UL=put(0, 7.1);
    413         end;
    414         */
    415         /* if (0<wgt_percent<1) then do;  */
    416                 stderr=sqrt(wgt_var);
    417                 t1=(wgt_percent-(1.96*stderr));
    418                 if (t1<0) then t1=0;
    419                         LL=t1;
    420                         UL=(wgt_percent+(1.96*stderr));
    421                 if UL > 100 then UL = 100;
    422         /*  end;  */
    423        
    424         if (wgt_percent=1) then do;
    425                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    426                 stderr=0;
    427                 LL=put(0, 7.1);
    428                 UL=put(0, 7.1);
    429         end;
    430        
     403        stderr=sqrt(wgt_var);
     404        t1=(wgt_percent-(1.96*stderr));
     405        if (t1<0) then t1=0;
     406                LL=t1;
     407                UL=(wgt_percent+(1.96*stderr));
     408        if UL > 100 then UL = 100;
     409
    431410        LL=compress(LL);
    432411        UL=compress(UL);
     
    528507**************************************************************************;
    529508data Stability;
    530    set tmp6;
    531    
     509        set tmp6;
     510       
     511        if &varname. = '.' then delete;
    532512        redflag=put('Stable', $14.);
    533  
    534   RSE=(StdErr/wgt_percent);
    535    *if RSE = . then RSE = 0; * is this reasonable?;
    536    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    537    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    538    if &varname. = '.' then delete;
    539    
    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';
     513       
     514        RSE=(StdErr/wgt_percent);
     515
     516        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    541517run;
    542518
     
    558534
    559535/* ask Lois about the following  */
    560 
    561536        if UL > 100 then UL = 100;
    562         /* need to compute LL and UL when there is no variance */
     537
     538/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    563539        if (wgt_percent = 0) OR (wgt_percent = 1) then
    564540                do;
     
    566542                        UL=Ageadj_percent;
    567543                        RSE=0;
     544                        redflag=put('No Variance', $14.);
    568545                end;
    569546
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateCRC.sas

    r21710 r21711  
    384384
    385385/**********
    386         OLD Asymmetirec?
     386        OLD Asymmetric?
    387387                 f=log(wgt_percent)-log(1-wgt_percent); 
    388388                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    395395*********/
    396396
    397 
    398         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    399         /* commenting out, not sure if I need to do theis
    400         if (wgt_percent<=0) then do;
    401                 wgt_percent=0;
    402                 wgt_percent=0;
    403                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    404                 stderr=0;
    405                 LL=put(0, 7.1);
    406                 UL=put(0, 7.1);
    407         end;
    408         */
    409         /* if (0<wgt_percent<1) then do;  */
    410                 stderr=sqrt(wgt_var);
    411                 t1=(wgt_percent-(1.96*stderr));
    412                 if (t1<0) then t1=0;
    413                         LL=t1;
    414                         UL=(wgt_percent+(1.96*stderr));
    415                 if UL > 100 then UL = 100;
    416         /*  end;  */
    417        
    418         if (wgt_percent=1) then do;
    419                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    420                 stderr=0;
    421                 LL=put(0, 7.1);
    422                 UL=put(0, 7.1);
    423         end;
    424        
     397        stderr=sqrt(wgt_var);
     398        t1=(wgt_percent-(1.96*stderr));
     399        if (t1<0) then t1=0;
     400                LL=t1;
     401                UL=(wgt_percent+(1.96*stderr));
     402        if UL > 100 then UL = 100;
     403
    425404        LL=compress(LL);
    426405        UL=compress(UL);
     
    522501**************************************************************************;
    523502data Stability;
    524    set tmp6;
    525    
     503        set tmp6;
     504       
     505        if &varname. = '.' then delete;
    526506        redflag=put('Stable', $14.);
    527  
    528   RSE=(StdErr/wgt_percent);
    529    *if RSE = . then RSE = 0; * is this reasonable?;
    530    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    531    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    532    if &varname. = '.' then delete;
    533    
    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';
     507       
     508        RSE=(StdErr/wgt_percent);
     509
     510        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    535511run;
    536512
     
    552528
    553529/* ask Lois about the following  */
    554 
    555530        if UL > 100 then UL = 100;
    556         /* need to compute LL and UL when there is no variance */
     531
     532/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    557533        if (wgt_percent = 0) OR (wgt_percent = 1) then
    558534                do;
     
    560536                        UL=Ageadj_percent;
    561537                        RSE=0;
     538                        redflag=put('No Variance', $14.);
    562539                end;
    563540
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateDist8.sas

    r21710 r21711  
    389389
    390390/**********
    391         OLD Asymmetirec?
     391        OLD Asymmetric?
    392392                 f=log(wgt_percent)-log(1-wgt_percent); 
    393393                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    400400*********/
    401401
    402 
    403         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    404         /* commenting out, not sure if I need to do theis
    405         if (wgt_percent<=0) then do;
    406                 wgt_percent=0;
    407                 wgt_percent=0;
    408                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    409                 stderr=0;
    410                 LL=put(0, 7.1);
    411                 UL=put(0, 7.1);
    412         end;
    413         */
    414         /* if (0<wgt_percent<1) then do;  */
    415                 stderr=sqrt(wgt_var);
    416                 t1=(wgt_percent-(1.96*stderr));
    417                 if (t1<0) then t1=0;
    418                         LL=t1;
    419                         UL=(wgt_percent+(1.96*stderr));
    420                 if UL > 100 then UL = 100;
    421         /*  end;  */
    422        
    423         if (wgt_percent=1) then do;
    424                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    425                 stderr=0;
    426                 LL=put(0, 7.1);
    427                 UL=put(0, 7.1);
    428         end;
    429        
     402        stderr=sqrt(wgt_var);
     403        t1=(wgt_percent-(1.96*stderr));
     404        if (t1<0) then t1=0;
     405                LL=t1;
     406                UL=(wgt_percent+(1.96*stderr));
     407        if UL > 100 then UL = 100;
     408
    430409        LL=compress(LL);
    431410        UL=compress(UL);
     
    527506**************************************************************************;
    528507data Stability;
    529    set tmp6;
    530    
     508        set tmp6;
     509       
     510        if &varname. = '.' then delete;
    531511        redflag=put('Stable', $14.);
    532  
    533   RSE=(StdErr/wgt_percent);
    534    *if RSE = . then RSE = 0; * is this reasonable?;
    535    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    536    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    537    if &varname. = '.' then delete;
    538    
    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';
     512       
     513        RSE=(StdErr/wgt_percent);
     514
     515        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    540516run;
    541517
     
    559535        if UL > 100 then UL = 100;
    560536
    561 /* need to compute LL and UL when there is no variance */
     537/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    562538        if (wgt_percent = 0) OR (wgt_percent = 1) then
    563539                do;
     
    565541                        UL=Ageadj_percent;
    566542                        RSE=0;
     543                        redflag=put('No Variance', $14.);
    567544                end;
    568545
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyAARateDist8NoVarLevel.sas

    r21710 r21711  
    319319
    320320/**********
    321         OLD Asymmetirec?
     321        OLD Asymmetric?
    322322                 f=log(wgt_percent)-log(1-wgt_percent); 
    323323                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    330330*********/
    331331
    332 
    333         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    334         /* commenting out, not sure if I need to do theis
    335         if (wgt_percent<=0) then do;
    336                 wgt_percent=0;
    337                 wgt_percent=0;
    338                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    339                 stderr=0;
    340                 LL=put(0, 7.1);
    341                 UL=put(0, 7.1);
    342         end;
    343         */
    344         /* if (0<wgt_percent<1) then do;  */
    345                 stderr=sqrt(wgt_var);
    346                 t1=(wgt_percent-(1.96*stderr));
    347                 if (t1<0) then t1=0;
    348                         LL=t1;
    349                         UL=(wgt_percent+(1.96*stderr));
    350                 if UL > 100 then UL = 100;
    351         /*  end;  */
    352        
    353         if (wgt_percent=1) then do;
    354                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    355                 stderr=0;
    356                 LL=put(0, 7.1);
    357                 UL=put(0, 7.1);
    358         end;
    359        
     332        stderr=sqrt(wgt_var);
     333        t1=(wgt_percent-(1.96*stderr));
     334        if (t1<0) then t1=0;
     335                LL=t1;
     336                UL=(wgt_percent+(1.96*stderr));
     337        if UL > 100 then UL = 100;
     338
    360339        LL=compress(LL);
    361340        UL=compress(UL);
     
    454433**************************************************************************;
    455434data Stability;
    456    set tmp6;
    457    
     435        set tmp6;
     436       
     437        if &varname. = '.' then delete;
    458438        redflag=put('Stable', $14.);
    459  
    460   RSE=(StdErr/wgt_percent);
    461    *if RSE = . then RSE = 0; * is this reasonable?;
    462    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    463    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    464    if &varname. = '.' then delete;
    465    
    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';
     439       
     440        RSE=(StdErr/wgt_percent);
     441
     442        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    467443run;
    468444
     
    486462        if UL > 100 then UL = 100;
    487463
    488 /* need to compute LL and UL when there is no variance */
     464/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    489465        if (wgt_percent = 0) OR (wgt_percent = 1) then
    490466                do;
     
    492468                        UL=Ageadj_percent;
    493469                        RSE=0;
     470                        redflag=put('No Variance', $14.);
    494471                end;
    495472
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE40.sas

    r21706 r21711  
    394394
    395395/**********
    396         OLD Asymmetirec?
     396        OLD Asymmetric?
    397397                 f=log(wgt_percent)-log(1-wgt_percent); 
    398398                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    405405*********/
    406406
    407 
    408         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    409         /* commenting out, not sure if I need to do theis
    410         if (wgt_percent<=0) then do;
    411                 wgt_percent=0;
    412                 wgt_percent=0;
    413                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    414                 stderr=0;
    415                 LL=put(0, 7.1);
    416                 UL=put(0, 7.1);
    417         end;
    418         */
    419         /* if (0<wgt_percent<1) then do;  */
    420                 stderr=sqrt(wgt_var);
    421                 t1=(wgt_percent-(1.96*stderr));
    422                 if (t1<0) then t1=0;
    423                         LL=t1;
    424                         UL=(wgt_percent+(1.96*stderr));
    425                 if UL > 100 then UL = 100;
    426         /*  end;  */
    427        
    428         if (wgt_percent=1) then do;
    429                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    430                 stderr=0;
    431                 LL=put(0, 7.1);
    432                 UL=put(0, 7.1);
    433         end;
    434        
     407        stderr=sqrt(wgt_var);
     408        t1=(wgt_percent-(1.96*stderr));
     409        if (t1<0) then t1=0;
     410                LL=t1;
     411                UL=(wgt_percent+(1.96*stderr));
     412        if UL > 100 then UL = 100;
     413
    435414        LL=compress(LL);
    436415        UL=compress(UL);
     
    532511**************************************************************************;
    533512data Stability;
    534    set tmp6;
    535    
     513        set tmp6;
     514       
     515        if &varname. = '.' then delete;
    536516        redflag=put('Stable', $14.);
    537  
    538   RSE=(StdErr/wgt_percent);
    539   /* if 0<wgt_percent<.50 then RSE=(StdErr/wgt_percent);  */
    540 /* if .50&lt;=wgt_percent&lt;.95 then RSE=(StdErr/(1-wgt_percent));   REMOVING , NOT USED IN CRUDE  */
    541  
    542 /*      RSE=(StdErr/wgt_percent); */
    543  
    544    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    545    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    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';
     517       
     518        RSE=(StdErr/wgt_percent);
     519
     520        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    549521run;
    550522
     
    568540        if UL > 100 then UL = 100;
    569541
    570 /* need to compute LL and UL when there is no variance */
     542/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    571543        if (wgt_percent = 0) OR (wgt_percent = 1) then
    572544                do;
     
    574546                        UL=Ageadj_percent;
    575547                        RSE=0;
     548                        redflag=put('No Variance', $14.);
    576549                end;
    577550
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE40NoVarLevel.sas

    r21710 r21711  
    327327
    328328/**********
    329         OLD Asymmetirec?
     329        OLD Asymmetric?
    330330                 f=log(wgt_percent)-log(1-wgt_percent); 
    331331                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    338338*********/
    339339
    340 
    341         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    342         /* commenting out, not sure if I need to do theis
    343         if (wgt_percent<=0) then do;
    344                 wgt_percent=0;
    345                 wgt_percent=0;
    346                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    347                 stderr=0;
    348                 LL=put(0, 7.1);
    349                 UL=put(0, 7.1);
    350         end;
    351         */
    352         /* if (0<wgt_percent<1) then do;  */
    353                 stderr=sqrt(wgt_var);
    354                 t1=(wgt_percent-(1.96*stderr));
    355                 if (t1<0) then t1=0;
    356                         LL=t1;
    357                         UL=(wgt_percent+(1.96*stderr));
    358                 if UL > 100 then UL = 100;
    359         /*  end;  */
    360        
    361         if (wgt_percent=1) then do;
    362                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    363                 stderr=0;
    364                 LL=put(0, 7.1);
    365                 UL=put(0, 7.1);
    366         end;
    367        
     340        stderr=sqrt(wgt_var);
     341        t1=(wgt_percent-(1.96*stderr));
     342        if (t1<0) then t1=0;
     343                LL=t1;
     344                UL=(wgt_percent+(1.96*stderr));
     345        if UL > 100 then UL = 100;
     346
    368347        LL=compress(LL);
    369348        UL=compress(UL);
     
    462441**************************************************************************;
    463442data Stability;
    464    set tmp6;
    465    
     443        set tmp6;
     444       
     445        if &varname. = '.' then delete;
    466446        redflag=put('Stable', $14.);
    467  
    468   RSE=(StdErr/wgt_percent);
    469    *if RSE = . then RSE = 0; * is this reasonable?;
    470    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    471    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    472    if &varname. = '.' then delete;
    473    
    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';
     447       
     448        RSE=(StdErr/wgt_percent);
     449
     450        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    475451run;
    476452
     
    494470        if UL > 100 then UL = 100;
    495471
    496 /* need to compute LL and UL when there is no variance */
     472/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    497473        if (wgt_percent = 0) OR (wgt_percent = 1) then
    498474                do;
     
    500476                        UL=Ageadj_percent;
    501477                        RSE=0;
     478                        redflag=put('No Variance', $14.);
    502479                end;
    503480
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADist10GE50.sas

    r21706 r21711  
    393393
    394394/**********
    395         OLD Asymmetirec?
     395        OLD Asymmetric?
    396396                 f=log(wgt_percent)-log(1-wgt_percent); 
    397397                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    404404*********/
    405405
    406 
    407         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    408         /* commenting out, not sure if I need to do theis
    409         if (wgt_percent<=0) then do;
    410                 wgt_percent=0;
    411                 wgt_percent=0;
    412                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    413                 stderr=0;
    414                 LL=put(0, 7.1);
    415                 UL=put(0, 7.1);
    416         end;
    417         */
    418         /* if (0<wgt_percent<1) then do;  */
    419                 stderr=sqrt(wgt_var);
    420                 t1=(wgt_percent-(1.96*stderr));
    421                 if (t1<0) then t1=0;
    422                         LL=t1;
    423                         UL=(wgt_percent+(1.96*stderr));
    424                 if UL > 100 then UL = 100;
    425         /*  end;  */
    426        
    427         if (wgt_percent=1) then do;
    428                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    429                 stderr=0;
    430                 LL=put(0, 7.1);
    431                 UL=put(0, 7.1);
    432         end;
    433        
     406        stderr=sqrt(wgt_var);
     407        t1=(wgt_percent-(1.96*stderr));
     408        if (t1<0) then t1=0;
     409                LL=t1;
     410                UL=(wgt_percent+(1.96*stderr));
     411        if UL > 100 then UL = 100;
     412
    434413        LL=compress(LL);
    435414        UL=compress(UL);
     
    531510**************************************************************************;
    532511data Stability;
    533    set tmp6;
    534    
     512        set tmp6;
     513       
     514        if &varname. = '.' then delete;
    535515        redflag=put('Stable', $14.);
    536  
    537   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  
    543    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    544    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    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';
     516       
     517        RSE=(StdErr/wgt_percent);
     518
     519        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    548520run;
    549521
     
    567539        if UL > 100 then UL = 100;
    568540
    569 /* need to compute LL and UL when there is no variance */
     541/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    570542        if (wgt_percent = 0) OR (wgt_percent = 1) then
    571543                do;
     
    573545                        UL=Ageadj_percent;
    574546                        RSE=0;
     547                        redflag=put('No Variance', $14.);
    575548                end;
    576549
  • adopters/md/trunk/src/main/backend_qModules/brfss23/SurveyRateAADistMDGE45.sas

    r21710 r21711  
    390390
    391391/**********
    392         OLD Asymmetirec?
     392        OLD Asymmetric?
    393393                 f=log(wgt_percent)-log(1-wgt_percent); 
    394394                   s=stderr/(wgt_percent*(1-wgt_percent));
     
    401401*********/
    402402
    403 
    404         * if wgt_percent=1 or wgt_percent=0, stderr=0, and CV or RSE=0, need to test for this case in suppression below;
    405         /* commenting out, not sure if I need to do theis
    406         if (wgt_percent<=0) then do;
    407                 wgt_percent=0;
    408                 wgt_percent=0;
    409                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    410                 stderr=0;
    411                 LL=put(0, 7.1);
    412                 UL=put(0, 7.1);
    413         end;
    414         */
    415         /* if (0<wgt_percent<1) then do;  */
    416                 stderr=sqrt(wgt_var);
    417                 t1=(wgt_percent-(1.96*stderr));
    418                 if (t1<0) then t1=0;
    419                         LL=t1;
    420                         UL=(wgt_percent+(1.96*stderr));
    421                 if UL > 100 then UL = 100;
    422         /*  end;  */
    423        
    424         if (wgt_percent=1) then do;
    425                 wgt_var=0;  *is this correct, and need to test for it in suppression below;
    426                 stderr=0;
    427                 LL=put(0, 7.1);
    428                 UL=put(0, 7.1);
    429         end;
    430        
     403        stderr=sqrt(wgt_var);
     404        t1=(wgt_percent-(1.96*stderr));
     405        if (t1<0) then t1=0;
     406                LL=t1;
     407                UL=(wgt_percent+(1.96*stderr));
     408        if UL > 100 then UL = 100;
     409
    431410        LL=compress(LL);
    432411        UL=compress(UL);
     
    528507**************************************************************************;
    529508data Stability;
    530    set tmp6;
    531    
     509        set tmp6;
     510       
     511        if &varname. = '.' then delete;
    532512        redflag=put('Stable', $14.);
    533  
    534   RSE=(StdErr/wgt_percent);
    535    *if RSE = . then RSE = 0; * is this reasonable?;
    536    if ((wgt_percent = 0) or (wgt_percent = 1)) then RSE=0; /* No Variance */
    537    if (wgt_percent = 0) OR (wgt_percent = 1) then redflag=put('No Variance', $14.);
    538    if &varname. = '.' then delete;
    539    
    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';
     513       
     514        RSE=(StdErr/wgt_percent);
     515
     516        proc print data=Stability noobs;  title2 'Stability labels prior to setting totals to .  and rounding and multiply by 100, deleting cross1 and cross2 totals';
    541517run;
    542518
     
    560536        if UL > 100 then UL = 100;
    561537
    562 /* need to compute LL and UL when there is no variance */
     538/* need to compute LL and UL when there is no variance and put No Variance in stability column*/
    563539        if (wgt_percent = 0) OR (wgt_percent = 1) then
    564540                do;
     
    566542                        UL=Ageadj_percent;
    567543                        RSE=0;
     544                        redflag=put('No Variance', $14.);
    568545                end;
    569546
Note: See TracChangeset for help on using the changeset viewer.