參見例如在MASS
包confint
函數(http://stat.ethz.ch/R-manual/R-devel/library/MASS/html/confint.html):
ldose <- rep(0:5, 2)
numdead <- c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12, 16)
sex <- factor(rep(c("M", "F"), c(6, 6)))
SF <- cbind(numdead, numalive = 20 - numdead)
budworm.lg0 <- glm(SF ~ sex + ldose - 1, family = binomial)
confint(budworm.lg0)
confint(budworm.lg0, "ldose")
的例子爲邏輯迴歸,但是這也將工作爲泊松迴歸。
這裏是從泊松迴歸(https://stat.ethz.ch/R-manual/R-devel/library/stats/html/confint.html)的stats
包文檔又如:
## from example(glm)
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3, 1, 9); treatment <- gl(3, 3)
glm.D93 <- glm(counts ~ outcome + treatment, family = poisson())
confint(glm.D93) # needs MASS to be present on the system
confint.default(glm.D93) # based on asymptotic normality
謝謝你的答案。我已經試過了,給出了以下R代碼:confint(poissmod2,'有氧運動$ x1',等級= 0.95)。但是,我得到一個錯誤:參數的長度爲零... – user3387899
歡迎來到SO。這些命令基本上工作。如果您的代碼存在其他問題,我可以幫助您提供可重現的示例。看到http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – majom
那麼,代碼似乎並沒有爲我工作......我不斷收到錯誤:'論點是長度爲零「。所以我的代碼仍然有問題? – user3387899