Forums | OpenR

OpenR: R & Statistics /
How to understand "offset" in gym() function?


Huanzhi Gong's profile picture
Posts: 11

31 March 2022, 3:18 PM

截屏2022-03-31 15.18.11.png

Edits to this post:
Jingyuan Lei's profile picture
Posts: 1

31 March 2022, 5:15 PM

For this question, firstly I should be sorry for the confusion here. When I found an example, I just paste the sample code into r and run it directly. So I didn't check the code carefully. Here is a potentially useful answer to this question. Hope it can help you understand this problem截屏2022-03-31 17.01.47.png

Shanxing Gong's profile picture
Posts: 6

31 March 2022, 9:01 PM

Jingyuan Lei just gave you a specific explaination. For saving other people's time, let me just give you a short answer. 

In a poisson regression, each continious variable should accord with poisson distribution. In this data, continious variable "case" accord with poisson distribution, but the continious variable "pop" does not accord with poisson distribution. So we need a offset(log(pop)) to make "pop" accord to poisson distribution. Then the "pop" can be in a poisson regression with "case". 

Huanzhi Gong's profile picture
Posts: 11

01 April 2022, 12:28 AM

Thank you for your explanation. However, I am still confused about why we need to plus “1” before “offset()”. 

4 results