# Visualising generalized linear model

What kind of plot are normally used in Generalized linear model and what are their interpretations?

Especially for Standardized deviance residual vs fitted value plot, what can we see from the plot?

## 1 Answer

From StatSoft, without links:

Diagnostics in the generalized linear model. The two basic types of residuals are the so-called Pearson residuals and deviance residuals. Pearson residuals are based on the difference between observed responses and the predicted values; deviance residuals are based on the contribution of the observed responses to the log-likelihood statistic. In addition, leverage scores, studentized residuals, generalized Cook's D, and other observational statistics (statistics based on individual observations) can be computed. For a description and discussion of these statistics, see Hosmer and Lemeshow (1989).

If you are using R:

lrfit <- glm( cbind(using,notUsing) ~ age * noMore + hiEduc , family=binomial)
summary(lrfit)
plot(lrfit)


Quoted from Germán Rodríguez:

R follows the popular custom of flagging significant coefficients with one, two or three stars depending on their p-values. Try plot(lrfit). You get the same plots as in a linear model, but adapted to a generalized linear model; for example the residuals plotted are deviance residuals (the square root of the contribution of an observation to the deviance, with the same sign as the raw residual).

The functions that can be used to extract results from the fit include

• residuals or resid, for the deviance residuals
• fitted or fitted.values, for the fitted values (estimated probabilities)
• predict, for the linear predictor (estimated logits)
• coef or coefficients, for the coefficients, and
• deviance, for the deviance.

Some of these functions have optional arguments; for example, you can extract five different types of residuals, called "deviance", "pearson", "response" (response - fitted value), "working" (the working dependent variable in the IRLS algorithm - linear predictor), and "partial" (a matrix of working residuals formed by omitting each term in the model). You specify the one you want using the type argument, for example residuals(lrfit,type="pearson").

Depending on your type of study, there might be corrections to apply.