RMB gallery

# simple example

rmb(formula = Freq ~ Type + Infl + Cont + Sat, data = housing, gap.mult = 2, 
    col.vars = c(FALSE, TRUE, TRUE, FALSE), label.opt = list(abbrev = 3))

plot of chunk unnamed-chunk-1

# with sqrt-transformation and horizontal splits only

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, gap.mult = 2, col.vars = c(TRUE, 
    TRUE, TRUE, TRUE), freq.trans = "sqrt", label.opt = list(abbrev = 3))

plot of chunk unnamed-chunk-2

# a generalized spineplot with the first category highlighted

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, spine = TRUE, cat.ord = 1, 
    mult = 2, col.vars = c(1, 3, 4), freq.trans = list("sqrt", 3), label.opt = list(abbrev = 2))

plot of chunk unnamed-chunk-3

# a generalized spineplot with all categories highlighted in a changed order

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, spine = TRUE, cat.ord = c(3, 
    1, 2), gap.mult = 2, col.vars = c(TRUE, FALSE, TRUE, TRUE), freq.trans = "sqrt", 
    label.opt = list(abbrev = 3))

plot of chunk unnamed-chunk-4

# the barchart version only for categories 1 and 3

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, cat.ord = c(1, 3), 
    gap.mult = 2, col.vars = c(TRUE, FALSE, TRUE, TRUE), freq.trans = "sqrt", 
    label.opt = list(abbrev = c(4, 1, 1, 1)))

plot of chunk unnamed-chunk-5

# with equal widths

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, eqwidth = TRUE, gap.mult = 2, 
    col.vars = c(TRUE, FALSE, TRUE, TRUE), label.opt = list(abbrev = 2, lab.tv = TRUE))

plot of chunk unnamed-chunk-6

“# —– models and residuals —– # # using the logistic model: Sat by Type only

#   residual shadings and expected values ```
rmb(formula = ~Type + Infl + Cont + Sat, data = housing, gap.mult = 2, col.vars = c(TRUE, 
    FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 2, 
    3), c(1, 4)), model.opt = list(use.expected.values = TRUE, resid.display = "color"))

plot of chunk unnamed-chunk-7

# residual values without shadings

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, gap.mult = 2, col.vars = c(TRUE, 
    FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 2, 
    3), c(1, 4)), model.opt = list(resid.display = "values"))

plot of chunk unnamed-chunk-8

# residual shadings and expected values

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, gap.mult = 2, col.vars = c(TRUE, 
    FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 2, 
    3), c(1, 4)), model.opt = list(use.expected.values = TRUE, resid.display = "color"))

plot of chunk unnamed-chunk-9

# barcharts with residual shadings and values

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, gap.mult = 2, col.vars = c(TRUE, 
    FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 2, 
    3), c(1, 4)))

plot of chunk unnamed-chunk-10

# spineplots with residual shadings and values

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, spine = TRUE, gap.mult = 2, 
    col.vars = c(TRUE, FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 
        2, 3), c(1, 4)))

plot of chunk unnamed-chunk-11

# piecharts with residual shadings and values

rmb(formula = ~Type + Infl + Cont + Sat, data = housing, circular = TRUE, gap.mult = 2, 
    col.vars = c(TRUE, FALSE, TRUE, TRUE), label.opt = list(abbrev = 3), expected = list(c(1, 
        2, 3), c(1, 4)))

plot of chunk unnamed-chunk-12

# ----- using an ftable to create the plot ----- #

tt = xtabs(Freq ~ Type + Cont + Infl + Sat, data = housing)
ft = ftable(tt, col.vars = c(1, 4))
rmb(tt, col = "seq")

plot of chunk unnamed-chunk-13

rmb(ft, col = "seq", col.opt = list(h = 140))

plot of chunk unnamed-chunk-14

# ----- using a glm model ----- #

mod1 <- glm(Freq ~ Type * Infl * Cont + Type * Sat, data = housing, family = poisson)
rmb(mod1, circular = TRUE, gap.mult = 2, col.vars = c(TRUE, FALSE, TRUE, TRUE), 
    label.opt = list(abbrev = 3), model.opt = list(use.expected.values = TRUE))

plot of chunk unnamed-chunk-15

# ----- the numeric mode and cuts ----- # # only three cuts to show how it works

data(olives)
rmb(~palmitoleic + stearic + Region, data = olives, cut = c(3, 3, 0))

plot of chunk unnamed-chunk-16

# a minority of extreme observations mess the display up:

require(ggplot2)
data(diamonds)
diamonds$lprice <- log(diamonds$price)
rmb(~depth + table + lprice, data = diamonds, eqwidth = TRUE, spine = TRUE, 
    cut = c(36, 36, 5), col = "seq", num.mode = TRUE)

plot of chunk unnamed-chunk-17

# we can zoom in via innerval:

rmb(~depth + table + lprice, data = diamonds, circular = TRUE, cut = c(36, 36, 
    5), col = "div", innerval = 0.95, num.mode = TRUE, freq.trans = "log")