CIGLM: Wrapper to compute confidence intervals from glms

Description Usage Arguments Details Value See Also Examples

Description

Computes confidence intervals from the output of a glm, by calling to glht(multcomp).

Usage

1
CIGLM(x, conf.level = 0.95, method = c("Raw", "Adj", "Bonf"))

Arguments

x

a object of class "glm", "gamlss", or "glm.nb" as can be obtained by calling to function glm, function gamlss in package gamlss, or function glm.nb in package MASS

conf.level

confidence level, a single numeric value between 0.5 and 1

method

a single character string, with "Raw" for unadjusted intervals, "Adj" for multiplicity adjusted intervals taking the correlations into account, or "Bonf" for a Bonferroni adjustment

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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

BSagri documentation built on May 2, 2019, 8:29 a.m.

Related to CIGLM in BSagri...