BookmarkSubscribeRSS Feed
egaleano
Calcite | Level 5

Hello,

I would like parameters' names (or labels) to be shown in the Covariance (CovB) and Correlation (CorrB) matrix when I use the GENMOD procedure. In effect I only see prm1, prm2, etc... and if I use several covariates in the model I struggle to find out which parameter is correlated to another parameter.

Does anyone know how to achieve it?

Thank you

 

EG

2 REPLIES 2
PGStats
Opal | Level 21

Some post processing of the table data can yield a more informative correlation matrix. Starting with the logistic regression from the doc:

 

data drug;
   input drug$ x r n @@;
   datalines;
A  .1   1  10   A  .23  2  12   A  .67  1   9
B  .2   3  13   B  .3   4  15   B  .45  5  16   B  .78  5  13
C  .04  0  10   C  .15  0  11   C  .56  1  12   C  .7   2  12
D  .34  5  10   D  .6   5   9   D  .7   8  10
E  .2  12  20   E  .34 15  20   E  .56 13  15   E  .8  17  20
;

proc genmod data=drug;
   class drug;
   model r/n = x drug / dist = bin
                        link = logit
                        lrci corrb;
ods output parmInfo=pi corrb=cb;
run;

data pi2;
set pi;
length label $32;
label = catx("=", Effect, drug);
run;

proc sql;
select catx("=", parameter, quote(trim(label)))
into :labels separated by " "
from pi2;
quit;

data cb2;
set cb(rename=rowname=parameter); set pi2; by parameter notsorted;
label &labels.;
run;

title "Correlation between parameter estimates";
proc print data=cb2 label noobs; var label prm: ; run;
                      Correlation between parameter estimates

   label        Intercept          x     drug=A     drug=B     drug=C     drug=D

   Intercept      1.0000     -0.7550    -0.3098    -0.3787    -0.1956    -0.2279
   x             -0.7550      1.0000     0.0181    -0.0880    -0.1000    -0.1920
   drug=A        -0.3098      0.0181     1.0000     0.3050     0.1849     0.2533
   drug=B        -0.3787     -0.0880     0.3050     1.0000     0.2895     0.4030
   drug=C        -0.1956     -0.1000     0.1849     0.2895     1.0000     0.2543
   drug=D        -0.2279     -0.1920     0.2533     0.4030     0.2543     1.0000
PG
egaleano
Calcite | Level 5
Thank you!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2 replies
  • 2664 views
  • 4 likes
  • 2 in conversation