Table of Contents

DESCRIPTION

A function to plot confidential interval for such as ‘htest’, ‘glm’ (logistic regression only!) and ‘posthocTGH’ {userfriendlyscience} objects.

Usage

‘htest’ object

CIplot(x,
       log = FALSE,
       xlim = NULL, xlab = NULL, main = NULL,
       pch = 21, pcol = "black", pcolbg = "white", pcex = 1,
       cilty = 1, cilwd = 1, cicol = "black",
       v = NULL, vlty = 2, vlwd = 1,  vcol = "black",
       ...)

‘glm’ object (logistic regression only!)

CIplot(x,
       conf.level = 0.95,
       xlim = NULL, xlab = "Odds Ratio",
       main = NULL,
       pch = 21, pcol = "black",
       pcolbg = "white", pcex = 1, cilty = 1, cilwd = 1,
       cicol = "black", vlty = 2, vlwd = 1,  vcol = "black",
       las = NULL,
       ...)

‘posthocTGH’ object (Tukey or Games-Howell method)

CIplot(x,
       xlim = NULL, xlab = "Differences in mean", main = NULL,
       pch = 21, pcol = "black", pcolbg = "white", pcex = 1,
       cilty = 1, cilwd = 1, cicol = "black",
       vlty = 2, vlwd = 1,  vcol = "black",
       las = NULL,
       ...)

Arguments

Examples

‘htest’ object

Difference [log = FALSE (default)]

set.seed(1234)
x <- rnorm(10, 10, 2); y <- rnorm(10, 8, 2)
res <- t.test(x, y)
CIplot(res)

x <- binom.test(20, 100, 0.3)
CIplot(x)

x <- matrix(c(10, 7, 8, 9), 2, 2, byrow = TRUE)
res <- prop.test(x)
CIplot(res)

res <- chisq.test(x)
CIplot(x)                  ## Warning and no plot

set.seed(1234)
x <- cor.test(rnorm(10), rnorm(10))
CIplot(x, xlim = c(-1, 1))

Ratio (log = TRUE)

x <- var.test(1:10, (1:10)*1.5)
CIplot(x, log = TRUE)

x <- matrix(c(10, 7, 8, 9), 2, 2, byrow = TRUE)
res <- fisher.test(x)
CIplot(res, log = TRUE)

library(exact2x2)
x <- mcnemar.exact(dat)
CIplot(x, log = TRUE)

‘glm’ object

library(MASS)
data(birthwt)
x <- glm(low ~  age + lwt + smoke + ptl + ht + ui, data = birthwt,
         family = binomial)
CIplot(x, las = 1)

OR1 <- ORci(x)
CIplot(OR1, las = 1)

‘posthocTGH’ object

library(userfriendlyscience)
x <- posthocTGH(warpbreaks$breaks, warpbreaks$tension)
CIplot(x, las = 1)