[R] using "logLik" with AIC to compare models with different error

From: kyoung <kyoung_at_uvic.ca>
Date: Tue, 04 Mar 2008 10:11:07 -0800 (PST)

Hi there, I’d like to use AIC to compare between models with different error distributions (eg: Dick 2004, Sileshi 2004, Burnham and Anderson 2002), namely a normal, Poisson and negative binomial. I realize there are differing views whether this is valid or not from reading past R help postings; however, for my purpose I think AIC is more appropriate rather than something such as a Chi-sq or G-statistic as I don’t need to know whether the fit is statistically significant or not, rather I want to know which model is the best given my data.

The data I’m working on are counts per station (7 stations in total for each model), and originally I used a simplistic glm model:


And from the MASS package (v 7.2-30)


I then extracted the log-likelihood using “logLik(model)”, from which I calculated AIC (by hand). However, after reviewing more of the R help postings and associated help pages for the functions, I have the following questions:

1- the “glm” function doesn’t use MLE to fit the model, so is the associated “logLik” extracted valid?

2- If it is valid, does it calculate the full likelihood, or are the constants dropped? (this is not clear in the ?glm or ?loglik files)

3- if neither are valid, are there alternatives? For example, I’ve seen that the MASS package also has a “fit.distr” function with an associated “logLik” method, but can I use the log-likelihood extracted using this method to calculate AIC and compare between distributions (in the manner that I want using the “glm” function)? if so, are the log-likelihood given complete or have the constants been dropped?

Any help and suggestions would be appreciated!

Kelly Young
M.Sc Candidate, Dept. Biology
Fisheries Oceanography Research Lab
University of Victoria

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. Received on Tue 04 Mar 2008 - 18:14:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 04 Mar 2008 - 18:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive