# Fit of generalized linear model (Poisson distribution)

#### haldelberg

##### New Member
Hi guys

Can anyone tell us how to evaluate the fit of our generalized linear model with a poisson distribution? We can't really tell if the model is a good fit or not. Do you use the deviance to answer this question? If so, what does it tell us in the following example? Thank you in advance!

aggression ~ factor(gender) + (1|random) + factor(housing_type) + offset(log(duration_observation))
Data: data

AIC BIC LogLik deviance df.resid
287.0 295.3 -139.5 279.0 56

Scaled residuals:
Min 1Q Median 3Q Max
-1.33232 -0.45374 0.00103 0.33500 0.93121

Random effects:
Groups Name Variance Std.Dev.
random (intercept) 0.6145 0.7839
Number of obs: 60, groups: group, 60

Fixed effects:
Estimate Std. Error z-value Pr(>|z|)
(Intercept) -4.4198 0.4449 -9.935 < 2e-16***
factor(gender)1 0.9060 0.2921 3.102 0.00192***
factor(housing_type)1 1.0841 0.3829 2.831 0.00464***
---

Signif. codes:
0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

#### shahnawaz

##### New Member
In order to assess the fit of a generalized linear model you can use the Mc-Fadden's pseudo R square. Follow this link to a forum- http://stats.stackexchange.com/questions/82105/mcfaddens-pseudo-r2-interpretation
Here is link for calculating that in R- http://artax.karlin.mff.cuni.cz/r-help/library/pscl/html/pR2.html
Additionally you can also do test and validation setting and compare the Mean square errors http://en.wikipedia.org/wiki/Cross-validation_(statistics)
Also a way to perform cross validation in R- http://www.uni-kiel.de/psychologie/rexrepos/posts/crossvalidation.html