Estimate statement in Proc genmod for Poisson regression
Source:    Publish Time: 2013-04-07 04:50   7258 Views   Size:  16px  14px  12px
Author: Xuanqian Xie  /*Report: Second model is the final model*/  Ods select Estimates; proc genmod

Author: Xuanqian Xie

 /*Report: Second model is the final model*/

 Ods select Estimates;

proc genmod data= fin_data desc;

    where group ^= "use3";

    class Group sex age clop_days hosp_30 Stay_total

         co_diab Co_heart_fa  co_pvs co_renal ;

    model end_all =  Group sex age drug_days hosp_30 Stay_total

       co_diab Co_heart_fa  co_pvs co_renal 

       /link=log dist=poisson offset=log_days type3 scale=pearson;

 

      estimate "stop3: Incidence rate per 1000 patient-days" intercept 1  group 1  0  0 /exp;

    estimate "stop9: Incidence rate per 1000 patient-days" intercept 1  group 0  1  0 /exp;

    estimate "use9:  Incidence rate per 1000 patient-days" intercept 1  group 0  0  1 /exp;

 

    estimate "IRR: stop3 vs. use9"  group 1  0 -1 /exp;

    estimate "IRR: stop3 vs. stop9" group 1 -1  0 /exp;

    estimate "IRR: stop9 vs. use9"  group 0  1 -1 /exp;

 

    estimate "Sex  Male vs. Female " sex -1 1 / exp;

      estimate "IRR: Age ( < 55) vs. Age (65-74)" age 1 0 -1 0  0 /exp;

    estimate "IRR: Age (55-64) vs. Age (65-74)" age 0 1 -1 0  0 /exp;

    estimate "IRR: Age (75-84) vs. Age (65-74)" age 0 0 -1 1  0 /exp;

      estimate "IRR: Age ( > 85) vs. Age (65-74)" age 0 0 -1 0  1 /exp;

 

    estimate "IRR: Drug_days  =< 28 vs. > 90"  clop_days 1  0 -1 /exp;

    estimate "IRR: Drug_days  29-90 vs. > 90"  clop_days 0  1 -1 /exp;

    estimate "IRR: stay in hospital: days >10  vs. < 10"  Stay_total -1  1 /exp;

    estimate "Hospitalization within1 month (YES vs. NO)"

                  hosp_30 -1  1 /exp;

 

    estimate "Diabetes :YES vs. NO " co_diab  -1 1 / exp;

    estimate "Congestive heart failure :YES vs. NO " Co_heart_fa -1 1 / exp;

    estimate " Peripheral vascular disease:YES vs. NO " co_pvs -1 1 / exp;

    estimate " Renal disease YES vs. NO"  co_renal  -1 1 / exp;

 

      title "Poisson regression : Final model";

    title2;

    title3 "&systime  &sysdate9";

 

run;



Note: from SAS 9.2, the option “exp” was not required.


/* 2.1: Events reported        */ sas 9.2

 /*Events per 1,000 patient-days by years*/

proc genmod data=final order=data;

    class year ;  

    model f1000 = year/link=log dist=poisson offset=log_day type3 COVB;

 

    estimate "Events per 1,000 patient-days, 2006-07" intercept 1  year 0 0 0 1 0;

    estimate "Events per 1,000 patient-days, 2007-08" intercept 1  year 0 0 1 0 0;

    estimate "Events per 1,000 patient-days, 2008-09" intercept 1  year 0 1 0 0 0;

    estimate "Events per 1,000 patient-days, 2009-10" intercept 1  year 1 0 0 0 0;

    estimate "Events per 1,000 patient-days, 2005-06" intercept 1  year 0 0 0 0 1;

 

run;

 

 

 

/*Compare overall fall incidence rates by years, without adjustment for sites*/

proc genmod data=final order=data;

    class year Centre;  

    model Events = year Centre /link=log dist=poisson offset=log_day type3 COVB;

 

    estimate "2005-06 vs. 2009-10"  year  -1 0 0 0 1;

    estimate "2006-07 vs. 2009-10"  year  -1 0 0 1 0;

    estimate "2007-08 vs. 2009-10"  year  -1 0 1 0 0;

    estimate "2008-09 vs. 2009-10"  year  -1 1 0 0 0;

 

    estimate "2005-06 vs. 2007-08"  year  0  0 -1 0 1;

    estimate "2006-07 vs. 2007-08"  year  0  0 -1 1 0;

    estimate "2008-09 vs. 2007-08"  year  0  1 -1 0 0;

    estimate "2009-10 vs. 2007-08"  year  1  0 -1 0 0;

 

      estimate "2006-07 vs. 2005-06"  year  0 0 0 1 -1;

    estimate "2007-08 vs. 2005-06"  year  0 0 1 0 -1;

    estimate "2008-09 vs. 2005-06"  year  0 1 0 0 -1;

    estimate "2009-10 vs. 2005-06"  year  1 0 0 0 -1;

 

run;

 

 

An example of overdispersion in Poisson regression

 

                             Criteria For Assessing Goodness Of Fit

 

                  Criterion                     DF           Value        Value/DF

 

                  Deviance                     220        125.0134          0.5682

                  Scaled Deviance              220        125.0134          0.5682

                  Pearson Chi-Square           220        211.9816          0.9636

                  Scaled Pearson X2            220        211.9816          0.9636

                  Log Likelihood                          -84.9836

                  Full Log Likelihood                     -92.0328

                  AIC (smaller is better)                 202.0656

                  AICC (smaller is better)                202.8876

                  BIC (smaller is better)                 232.9691

 

Prev articleA SAS Macro of partitioning subsets (logistic regression)
Next article:No next article