I read somewhere that you could compute a "residual value" for a GLM by taking the actual values of your response variable divided by the predicted value of that response variable.
For example, suppose the response variable y represents number of cars, and $x_1$ represents the age of. a car. We would fit a glm model and calculate the "residual value", denoted
residual below, for every observation in our data set with something like the following in R:
library(dplyr) m <- glm(y~x_1,data=dataset, family=poisson(link='log')) dataset <- dataset %>% mutate(pred_value = predict(m,type='response)) dataset %>% mutate(residual = y/pred_value)
I'm wondering if that actually makes sense, since unlike linear regression the GLM equation generally doesn't contain a residual term in it.
If not, what would be the best way to compare predicted versus expected values? The goal is the see if one can derive a 2nd predictor from the noise not modeled by the GLM model.