参见例如在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