To play a little bit with GLMs, I tried this simulation:
- I generated a variable $x$ with two levels, $A$ and $B$.
- I generated a variable $y$ by drawing from a Poisson distribution with parameter $0.1$ if $x=A$ and $10$ if $x=B$.
Then I applied a linear model and a GLM with Poisson family. The results I get are very similar: the linear model says that when $X=A$ the mean of $Y$ is 0.06, while when $X=B$ the mean is $10.02$. The GLM gives me the means $0.06$ and $10.02$ respectively.
I also tried different combinations of parameters for the Poisson distribution (e.g. 0.1 and 0.5 to avoid that the Poisson is approximated by a Gaussian), but the results of the linear model always agreed with the ones of the GLM.
So my question is: am I doing something wrong? If the linear model gives similar results as the GLM, why using a GLM (Talking from a practical point of view... of course from a theoretical point of view the GLM is better in this case)?