Poisson offset問題

看板Statistics作者 (marki)時間4年前 (2020/06/09 11:03), 編輯推噓3(3010)
留言13則, 4人參與, 4年前最新討論串1/1
應該是近期的最後一題 @@ https://sites.google.com/site/rlearningsite/catagory/poisson 網頁的最後倒數第二個部分 5.Poisson迴歸應用於比例資料 裡面有提到如果是要計算比例資料 要設offset 我的問題是為什麼不能直接先算出每一年的cancer占死亡人口的比率 再把這個比率放到應變數跑就好呢? 我試著這樣子跑 會有些許的差異 不清楚為什麼? 我的R code如下: > death=read.csv("/Users/chihchiachen/Downloads/Death.csv") > Year_re<-c(24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) > death_cb<-cbind(death, cbind(Year_re)) > deathc=death_cb$Cancer/death_cb$Death #deathc就是cancer占死亡人口的比例 > death_cb<-cbind(death_cb, cbind(deathc)) > glm(formula = deathc ~ Year_re, family = poisson(link = log), data = death_cb) 結果: (Intercept) Year_re -1.7488 0.0229 跟網頁上的資料 Intercept 的coef是0.022461 Inctercept是-1.742616有些許的差異 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.116.253.37 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1591671802.A.C5D.html

06/09 14:11, 4年前 , 1F
offset也不單純是處理比例資料;「暴露量」意思比較接近
06/09 14:11, 1F

06/09 14:12, 4年前 , 2F
例如事件發生次數的觀測時間、面積、人口密度……
06/09 14:12, 2F

06/09 14:18, 4年前 , 3F
結果也不能直接互比,意義完全不同。
06/09 14:18, 3F

06/09 14:27, 4年前 , 4F
所以是只要是比例資料。理論上我就是要用offset 嗎?
06/09 14:27, 4F

06/09 14:28, 4年前 , 5F
而且poisson reg怎麼可能接受非負整數之外的應變數?
06/09 14:28, 5F

06/09 14:35, 4年前 , 6F
sorry我以為你改做成linear model。你要這麼做的話,可
06/09 14:35, 6F

06/09 14:40, 4年前 , 7F
採用quasipoisson,若次數很大則結果應該會很接近。
06/09 14:40, 7F

06/09 16:25, 4年前 , 8F
回到你的問題,offset的作用是調整暴露量使比較次數公
06/09 16:25, 8F

06/09 16:25, 4年前 , 9F
平。你所謂的 ”比例資料“ 的話可以視潛在事件發生的
06/09 16:25, 9F

06/09 16:25, 4年前 , 10F
所有對象數量為offset。
06/09 16:25, 10F

06/10 10:25, 4年前 , 11F
關鍵是要做 Poisson regression 還是忽略 Poisson 變量特性
06/10 10:25, 11F

06/10 10:27, 4年前 , 12F
直接用 rate 去 fit model 已經脫離 Poisson model 的假設.
06/10 10:27, 12F

06/14 22:03, 4年前 , 13F
Poisson是用count data喔
06/14 22:03, 13F
文章代碼(AID): #1UtllwnT (Statistics)