11-06-2015 11:15 AM
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;
11-20-2015 12:24 AM
See this thread:
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.
11-20-2015 05:42 PM
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).