[R] accessing log likelihood of poison model
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Sun Apr 18 00:52:19 CEST 2004
Eric Cheney <cheney at soc.umass.edu> writes:
> Could someone tell me how to access the log likelihood
> of a poisson model? I've done the following....
>
> <BEGIN R STUFF>
>
> freq.mod <- glm(formula = nfix ~ gls.gls + pol.gls + pol.rel + rac.gls +
> rac.pol + rac.rac + rac.rel + white + gls.gls.w + pol.gls.w + pol.rel.w
> + rac.gls.w + rac.pol.w + rac.rac.w + rac.rac.w + rac.rel.w, family =
> poisson, data = Complex2.freq, offset = lnoffset)
>
> summary(freq.mod)
> anova(freq.mod)
>
> <END R STUFF>
>
> And that's great; but I need the log likelihood.
>
> Anyone know?
The deviance will not suffice?
sum(dpois(nfix, fitted(freq.mod), log.p=T))
should do the trick otherwise.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list