Hello all, I was wondering if someone can enlighten me as to the difference between the logLik in R vis-a-vis Stata for a GLM model with the gamma family.
Stata calculates the loglikelihood of the model as (in R notation) some equivalent function of -1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+log(scale)+scale*lgamma(1/scale)) where scale (or dispersion) = 1, Y = the response variable, and mu is the fitted values given by the fitted model. R seems to use a very similar approach, but scale is set equal to the calculated dispersion for the gamma model. However, when I calculate the logLik by hand this way the answer differs slightly (about .5) from the logLik(glm.m1). I haven't been able to figure out why looking at the help. If anyone has any ideas, the insight would be much appreciated. Cheers, Skipper ______________________________________________ R-help@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.