Dear R-helpers, I would like to compare the fit of two models, one of which I fit using lm() and the other using glm(family=poisson). The latter doesn't provide r-squared, so I wonder how to go about comparing these models (they have the same formula). Thanks very much, Mark Na [[alternative HTML version deleted]]
i don't understand how you can fit a poisson model with lm() function. otherwise, how could you compare lm() with glm(...family=poisson)? On Fri, Jul 31, 2009 at 7:41 PM, Mark Na<mtb954 at gmail.com> wrote:> Dear R-helpers, > I would like to compare the fit of two models, one of which I fit using lm() > and the other using glm(family=poisson). The latter doesn't provide > r-squared, so I wonder how to go about comparing these > models (they have the same formula). > > Thanks very much, > > Mark Na > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- =============================WenSui Liu Blog : statcompute.spaces.live.com Tough Times Never Last. But Tough People Do. - Robert Schuller ==============================
Mark Na <mtb954 <at> gmail.com> writes:> > Dear R-helpers, > I would like to compare the fit of two models, one of which I fit using lm() > and the other using glm(family=poisson). The latter doesn't provide > r-squared, so I wonder how to go about comparing these > models (they have the same formula). > > Thanks very much, > > Mark Na >I'm not sure what you are trying to do but it might be informative to compare the diagnostic plots from the fits. Remember that Poisson distributed data is heteroscedastic, mean = variance, which isn't the default hypothesis when fitting with lm. Also, the default link function with the poisson family is log. So, these are things to take into account in any potential comparison. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen L?pine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html
Mark Na wrote:> > Dear R-helpers, > I would like to compare the fit of two models, one of which I fit using > lm() > and the other using glm(family=poisson). The latter doesn't provide > r-squared, so I wonder how to go about comparing these > models (they have the same formula). > > Thanks very much, > > Mark Na > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >The decision which distribution to use (Normal versus Poisson) should be an a priori choice. If you really want to compare them, then inspect the residuals of both models and see which model doesn't have any residual patterns. Alain ----- -------------------------------------------------------------------- Dr. Alain F. Zuur First author of: 1. Analysing Ecological Data (2007). Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p. 2. Mixed effects models and extensions in ecology with R. (2009). Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer. 3. A Beginner's Guide to R (2009). Zuur, AF, Ieno, EN, Meesters, EHWG. Springer Statistical consultancy, courses, data analysis and software Highland Statistics Ltd. 6 Laverock road UK - AB41 6FN Newburgh Email: highstat at highstat.com URL: www.highstat.com -- View this message in context: http://www.nabble.com/Compare-lm%28%29-to-glm%28family%3Dpoisson%29-tp24764558p24772802.html Sent from the R help mailing list archive at Nabble.com.