[程式] R的指令glmmPQL

看板Statistics作者 (持續努力中~)時間13年前 (2012/08/14 08:17), 編輯推噓1(106)
留言7則, 3人參與, 最新討論串1/1
[軟體程式類別]: R [程式問題]: 找不到如何取出裡面的值 資料處理、迴歸、敘述統計、logistic、probit...等 [軟體熟悉度]: 中~高 [問題敘述]: [程式範例]: 我使用R的library(MASS)中的glmmPQL 我可以順利的跑出我想要的程式 舉例來說 library(MASS) mydata=data.frame(x1=rnorm(10),x2=rnorm(10),y=rgamma(10,1,1),ID=seq(1:10)) glmmPQL(y ~ x1+x2 , random = ~ 1 | ID, family = Gamma(link="log"), data = mydata) 其中一次的結果如下 iteration 1 iteration 2 iteration 3 iteration 4 iteration 5 iteration 6 iteration 7 Linear mixed-effects model fit by maximum likelihood Data: mydata Log-likelihood: NA Fixed: y ~ x1 + x2 (Intercept) x1 x2 -1.578571696 0.968307141 -0.001152464 Random effects: Formula: ~1 | ID (Intercept) Residual StdDev: 0.8865233 0.3324462 Variance function: Structure: fixed weights Formula: ~invwt Number of Observations: 10 Number of Groups: 10 程式可以成功的跑出來 可是我有幾個問題 1.在output中哪裡可以找到gamma分配的scale parameter的估計值 2.因為我之後要做模擬跑一千次 所以我需要讀出裡面的幾個值 尤其是random effect的StdDev 0.8865233 我知道如果我用"...$sigma"得到的是0.3324462 3.可以要求在跑的過程中不要print iteration 1,iteration 2,...等等嗎 我卡在這幾個問題好久了 尤其1&2 請板上的各位高手幫幫忙指點一下 非常感謝!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 165.91.10.164

08/14 17:17, , 1F
result = suppressMessages(glmmPQL(y~x1+x2, ...))
08/14 17:17, 1F

08/14 17:17, , 2F
intervals(result)$r$I[2]
08/14 17:17, 2F

08/14 17:19, , 3F
第一個問題我不會,等高手回答 XD
08/14 17:19, 3F

08/14 23:37, , 4F
非常感謝樓上的回答,也麻煩其他高手幫幫我回答我的問題1,謝謝!
08/14 23:37, 4F

08/15 10:59, , 5F
1.attributes(objects)
08/15 10:59, 5F

08/22 04:16, , 6F
我使用attribute(objects) 可是還是沒看到哪裡有scale paramet
08/22 04:16, 6F

08/22 04:16, , 7F
er 可以請高手再指點一下嗎? 謝謝!
08/22 04:16, 7F
文章代碼(AID): #1GAPaon6 (Statistics)