BookmarkSubscribeRSS Feed
ndang3188
Calcite | Level 5

proc glm data=outmi;

   by _imputation_;

  class TRT02PN;

  model W24CHG=TRT02PN/solution;

  means TRT02PN /hovtest=leven(type=abs);

  ods output ParameterEstimates=coeff;

run;

 

I am trying to obtain variance covariance matrix of the Estimates and don't know what line of code I should you.

 

 

4 REPLIES 4
SteveDenham
Jade | Level 19

What do you see when you add the inverse option to the model statement:

 

proc glm data=outmi;
   by _imputation_;
  class TRT02PN;
  model W24CHG=TRT02PN/solution inverse;
  means TRT02PN /hovtest=leven(type=abs);
  ods output ParameterEstimates=coeff;
run;

And sometimes it is easier to step away from GLM and try something like this:

 

proc glimmix data=outmi;
   by _imputation_;
  class TRT02PN;
  model W24CHG=TRT02PN/solution covb;
    ods output ParameterEstimates=coeff covb=covb;
run;

This is solely to get the covariance matrix for the fixed effects, and not to combine the imputations.

 

SteveDenham

 

 

TomHsiung
Pyrite | Level 9

Thanks for sharing. I wonder how do we get the variance-covariance matrix of regression coefficients? Thanks.

Ksharp
Super User

You could try COVB option:

proc glimmix data=sashelp.heart ;
class sex;
model status=weight height sex/dist=binary corrb covb;
run;

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 4 replies
  • 893 views
  • 4 likes
  • 5 in conversation