Barplot2WayTable {catdap}R Documentation

Bar Plots for Two-Way Tables

Description

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

Usage

Barplot2WayTable(vname, resvar, exvar = NULL, tway.table, interval = NULL)

Arguments

vname

variable names.

resvar

names of the response variables.

exvar

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

tway.table

output tway.table of catdap1 or catdap2.

interval

output interval of catdap2.

Details

For continuous variables, we assume that b(1), b(2), …, b(m+1) are boundary values of m bins. Output value ranges r(i) (1 ≤ i ≤ m) are defined as follows :

r(i) = [ b(i), b(i+1) ) for 1 <= i < m,

r(m) = [ b(m), b(m+1) ] .

Examples

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

vname <- names(dimnames(Titanic))
Barplot2WayTable(vname, resvar, , z1$tway.table)

# catdap2 (Edgar Anderson's Iris Data)
# "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species" 
data(iris)
resvar <- "Petal.Width"
vname <- names(iris)
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(vname, resvar, exvar, z2$tway.table, z2$interval)

[Package catdap version 1.3.5 Index]