CIGLM {BSagri} | R Documentation |
Wrapper to compute confidence intervals from glms
Description
Computes confidence intervals from the output of a glm, by calling to glht(multcomp).
Usage
CIGLM(x, conf.level = 0.95, method = c("Raw", "Adj", "Bonf"))
Arguments
x |
a object of class |
conf.level |
confidence level, a single numeric value between 0.5 and 1 |
method |
a single character string, with |
Details
This is just a wrapper to confint.glht
of package multcomp
.
Note that except for the simple general linear model with assumption of Gaussian response, the resulting intervals are exact intervals. In other cases, the methods are only asymptotically correct, hence might give misleading results for small sample sizes!
Value
An object of class "confint.glht"
See Also
confint.glht
in package multcomp
for the function that is used internally,
UnlogCI
for a simple function to bring confidence intervals back to the original scales
when there is a log or logit link, with appropriate naming.
Examples
data(Diptera)
library(multcomp)
modelfit <- glm(Ges ~ Treatment, data=Diptera, family=quasipoisson)
comps <- glht(modelfit, mcp(Treatment="Tukey"))
CIs<-CIGLM(comps, method="Raw")
CIs
CIsAdj<-CIGLM(comps, method="Adj")
CIsAdj
CIsBonf<-CIGLM(comps, method="Bonf")
CIsBonf
library(gamlss)
modelfit2 <- gamlss(Ges ~ Treatment, data=Diptera, family=NBI)
comps2 <- glht(modelfit2, mcp(Treatment="Tukey"))
CIs2<-CIGLM(comps2, method="Raw")
CIs2
CIsAdj2<-CIGLM(comps2, method="Adj")
CIsAdj2
CIsBonf2<-CIGLM(comps2, method="Bonf")
CIsBonf2