BookmarkSubscribeRSS Feed
michellel
Calcite | Level 5

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;

1 REPLY 1
JacobSimonsen
Barite | Level 11

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 3360 views
  • 0 likes
  • 2 in conversation