Barplot2WayTable: Bar Plots for Two-Way Tables

Barplot2WayTableR Documentation

Bar Plots for Two-Way Tables

Description

Create bar plots for output two-way tables of catdap1() or catdap2().

Usage

Barplot2WayTable(x, exvar = NULL, gray.shade = FALSE)

Arguments

x

an output object of "catdap1" or "catdap2".

exvar

names of the explanatory variables. Default is all variables except resvar.

gray.shade

A logical value indicating whether the gamma-corrected grey palette should be used. If FALSE (default), any color palette is used.

Details

For continuous variables, we assume that b_1, b_2, \dots, b_{m+1} are boundary values of m bins. Output value ranges r_i (1 \le i \le m) are defined as follows :

r_i = \left[ \; b_i,\; b_{i+1}\; \right. ) \;\; \mathrm{for} \;1 \le i < m,

r_m = \left[ \; b_m,\; b_{m+1}\; \right] .

Examples

# catdap1c (Titanic data)
resvar <- "Survived"
z1 <- catdap1c(Titanic, resvar)

Barplot2WayTable(z1)

# catdap2 (Edgar Anderson's Iris Data)
# "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species" 
data(iris)
resvar <- "Petal.Width"
z2 <- catdap2(iris, c(0, 0, 0, -7, 2), resvar, c(0.1, 0.1, 0.1, 0.1, 0))

exvar <- c("Sepal.Length", "Petal.Length")
Barplot2WayTable(z2, exvar)

catdap documentation built on May 31, 2023, 6:14 p.m.