BookmarkSubscribeRSS Feed
yhung9
Calcite | Level 5

I can get r-square when processing OLS model. But...can I get r-square in proc GLM with log link and Poisson distribution? Here is SAS my code.

proc genmod data=;
model  =  / dist= poisson link=log;

 

Thank you.

2 REPLIES 2
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

See this thread:

 

 

https://communities.sas.com/t5/SAS-Statistical-Procedures/Calculate-R2-for-mixed-models-Nakagawa-and...

 

which include links to papers and R code. I would think that code to compute R^2 for a GLMM would also work for a GLM, but I've not tried it. I don't know whether SAS code is available; Steve Denham provides a rough outline of a SAS approach in one of his responses, but no code per se.

 

Good luck!

Susan

 

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Several versions of pseudo-R2 statistics have been proposed for generalized linear models (GLMs). Here is one developed in the 1990s by Cameron and WIndmeijer and by Waldhor. You need to run the procedure twice, once with the covariates (predictor variables, factors) and once without any covariates. Get the Deviance for each model fit (it is printed). Then,

pseduo-R2 = 1 - [Dev_full / Dev_red]

where Dev_full is the deviance for the full model (with all the predictors), and Dev_red is the deviance with no predictors. The argument for this R2 comes from the equivalence of deviances and sums of squares for linear models. You can read more about other approaches in Heinzl and Mittbock (2003; Computational Statistics and Data Analysis 44, pages 253-271).

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
  • 2 replies
  • 2067 views
  • 2 likes
  • 3 in conversation