Programming the statistical procedures from SAS

CI of IRR in proc genmod

Reply
Contributor
Posts: 66

CI of IRR in proc genmod

Hi, I am performing passion regression model, and trying to get CI for IRR, but not sure which code should be used. My code lists below. It can only shows the IRR without CI of IRR, like STATA results. Many thanks in advance for your answer!

proc genmod data=mydata;
class agegrp/ param=glm;
model vst = agegrp female northeast northcntrl west comor  /type3 dist=Poisson;
store p1;
run;

*to test if poisson model form fit the data;
data pvalue;
df = 230000; chisq = 214411.9595;
pvalue = 1 - probchi(chisq, df);
run;
proc print data=pvalue noobs;
run;

ods output ParameterEstimates = est;
proc plm source = p1;
show parameters;
run;
data est_exp;
set est;
irr = exp(estimate);
if parameter ^= "Intercept";
run;
proc print data= est_exp;
run;

Super Contributor
Posts: 271

Re: CI of IRR in proc genmod

You get the confidence intervals of the Log(IRR) in the parmest dataset. They can just be expontiated and you will have confidence intervals of IRR.

If you want the confidence intervals calculated within proc genmod you can use the estimate statement.

data abc;

  do i=1 to 100;

    group=int(5*ranuni(-1));

    y=rand('poisson',exp(group));

    output;

  end;

run;

ods output parameterestimates=parmest;

proc genmod data=abc;

  class group;

  model y=group/dist=poisson link=log;

run;

data parmest;

  set parmest;

  text=put(exp(estimate),5.2)||'('||put(exp(lowerwaldcl),5.2)||','||put(exp(upperwaldcl),5.2)||')';

  put parameter= @25 level1= text=;

run;

*and if you want the intervals calculated by genmod:;

ods output estimates=estimates;

proc genmod data=abc;

  class group;

  model y=group/dist=poisson link=log;

  estimate 'group 0 vs 4' group 1 0 0 0 -1/exp;

  estimate 'group 1 vs 4' group 0 1 0 0 -1/exp;

  estimate 'group 2 vs 4' group 0 0 1 0 -1/exp;

  estimate 'group 3 vs 4' group 0 0 0 1 -1/exp;

run;

Ask a Question
Discussion stats
  • 1 reply
  • 337 views
  • 0 likes
  • 2 in conversation