irmb {extracat}R Documentation

Interactive Multiple Barchart for relative frequencies and generalized Spineplots

Description

The irmb function is an interactive version of the basic rmb function. It provides sliders for x- and y-scales, variable inclusion/exclusion, axis changes, switching between barcharts and spineplots, model selection for residual shadings as well as a highlighting-like choice of the categories in the spineplot. It depends on iWidgets which only works with JGR.

Usage

irmb(f, dset, Z=100, use.na = FALSE,
 expected = TRUE, resid.type = "pearson",
 use.expected.values = FALSE, max.resid.scale = NULL,
 cut.rv = TRUE, cut.rs = 5, base = 0.2, mult = 1.5, 
 colv = NULL, yaxis = TRUE, min.alpha = 0.1, 
 base.alpha = 0.75, boxes = TRUE, lab.tv = FALSE,
 varnames = TRUE, abbr = FALSE, lab.cex = 1.2,...)

Arguments

f The formula specifying the variables in their given order with the last variable being the target variable. The left hand is either empty or denotes the frequency variable.
dset The dataset in form of a frequency table (see ftable or subtable for more information) with a column named "Freq" or in raw format (that is the rows represent the cases and the columns represent the variables).
Z The number of intervals for the sliders.
use.na Logical, specifying whether or not to drop cases with missing entries. If not, a category "N/A" will be created in each variable where missings occur.
expected Should model residuals be used to define the colors of the rectangles or bars?
resid.type "pearson", "deviance", "working", "partial" or "response". The underlying model is a glm poisson model.
use.expected.values Logical specifying whether or not to use the frequencies expected from the model instead of the observed ones in the dataset.
max.resid.scale If undefined the scale of the residuals will update with the model.
cut.rv A logical. If FALSE the residual shading alpha values will be chosen exactly and otherwise depending on the specified scale intervals.
cut.rs The number of cuttingpoints for the residual scale.
base The maximal proportion of the total plot width which is used for the gaps.
mult The incremental multiplier for the gaps of different dimensions.
colv A vector defining the colors of the bars or NULL for rainbow colors. Has no effect if expected = TRUE.
yaxis If TRUE a vertical axis will be drawn at both sides of the plot. This is recommended when using the y-axis slider.
min.alpha In case of eqwidth = T alpha blending with respect to the corresponding weight is applied to the background color of the bars. In order to save very sparse combinations from disappearing there is a minimum alpha value.
base.alpha A basic alpha value which will be applied to the bar colors. Does also work with residual shadings but not with colors chosen individually by setting colv
boxes Should the labels be surrounded by boxes?
lab.tv Should the target variable be included in the labeling?
varnames Should the variable names be shown as labels?
abbr If TRUE the labels will automatically be abbreviated (3 characters) using the abbreviate function.
lab.cex The fontsize multplier.
... Further arguments. Usually not necessary.

Details

The hlcat editable field allows to choose the categories for the spineplot mode. For example, 3,1,4 will put the third category on the bottom and then stack the first and fourth category. Category 2 will be left out. The model selection field has to contain the interaction terms to fit the glm poisson model. The single terms will be included automatically. The hsplit checkboxes can be used to switch variables from one axis to the other but it has no effect if the corresponding variable is the last one.

Value

No return value.

Note

This function is based on iWidgets and therefore needs JGR to run. iWidgets will be installed automatically from rforge.net on ots first run.

Author(s)

Alexander Pilhoefer
Department for Computer Oriented Statistics and Data Analysis
University of Augsburg
Germany

References

Alexander Pilhoefer New approaches in visualization of categorical data: R-package extracat
Journal of Statistical Software, submitted Jan 2010

Examples

## Not run: 
    data(housing)
    # example 1
    irmb(~Type+Infl+Cont+Sat,dset=housing,expected = TRUE, eqwidth=FALSE,base=0.2,mult=2,lab.tv=TRUE,abbr=TRUE)
    
    # example 2
    irmb(~Type+Infl+Cont+Sat,dset=housing,expected = FALSE, eqwidth = TRUE,base=0.2,mult=2,lab.tv=FALSE,abbr=TRUE)
## End(Not run)
 

[Package extracat version 1.0-0 Index]