[R] logLik for poisson models

John Sorkin jsorkin at grecc.umaryland.edu
Mon Feb 2 04:04:24 CET 2009


Antonio,

Given the model you used, the log link means you are modeling

log(expected value of y)=intercept

If you had an independent variable e.g. x
model <- glm(y ~ x, family=poisson())
you would be modeling

log(expected value of y)=intercept+x

John

John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

>>> <Antonio.Gasparrini at lshtm.ac.uk> 2/1/2009 8:47 PM >>>
Dear all,
 
I have a very basic question:
how does the logLik function work for poisson models?
 
Example:
I simulate 20 observations from a Poisson distribution with mean 800.
 
y <- rpois(20,800)
model <- glm(y ~ 1, family=poisson())
logLik(model)

I would like to know what's the exact formula the function logLik uses.
I looked at ?extractAIC but I cannot sort it out.
 
Can you please give me an help?
Thanks a lot

Antonio Gasparrini
Public and Environmental Health Research Unit (PEHRU)
London School of Hygiene & Tropical Medicine
Keppel Street, London WC1E 7HT, UK
Office: 0044 (0)20 79272406 - Mobile: 0044 (0)79 64925523
Skype contact: a.gasparrini
http://www.lshtm.ac.uk/people/gasparrini.antonio ( http://www.lshtm.ac.uk/pehru/ )

______________________________________________
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.

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}




More information about the R-help mailing list