sieveplot                package:vcd                R Documentation

_S_i_e_v_e _P_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Visualization of two-way contingency tables: plots rectangles with
     surfaces proportional to the expected cell frequencies and filled
     with a number of squares equal to the expected frequencies. Thus,
     the densities visualize the deviations of the observed from the
     expected values.

_U_s_a_g_e:

     ## Default S3 method:
     sieveplot(x, reverse.y = TRUE,
               type = c("sieve", "expected"), main = NULL,
               values = c("none", "cells", "margins", "both"),
               frequencies = c("absolute", "relative"),
               sieve.colors = c("red","blue"),
               sieve.lty = c("longdash", "solid"),
               exp.color = "gray", exp.lty = "dotted",
               margin = 0.01, cex.main = 2, cex.lab = 1.5,
               xlab = names(dimnames(x))[2],
               ylab = names(dimnames(x))[1], ...)
     ## S3 method for class 'formula':
     sieveplot(formula, data = NULL, ..., subset)

_A_r_g_u_m_e_n_t_s:

       x: a two-way contingency table, as generated by 'table'.

reverse.y: if 'TRUE', the y axis is reversed (i.e., the rectangles'
          positions correspond to the contingency table).

    type: 'expected' fills the rectangles according to the _expected_
          frequencies.

    main: user specified title.

  values: optionally, the frequencies of the 'cells' or 'margins' or of
          'both' can be plotted.

frequencies: chooses the type of these frequencies: 'relative' or
          'absolute'.

sieve.colors, sieve.lty: vectors with up to two color/line type
          entries: the first is used for negative and the second for
          positive deviations from the expected frequencies.

exp.color, exp.lty: color/line type entry for the expected values grid.

  margin: lines of margin between the cell rectangles.

cex.main: font size of title.

 cex.lab: font size of labels.

xlab, ylab: labels of x- and y-axis.

 formula: a formula, such as 'y ~ x'. For details, see 'xtabs'.

    data: a data.frame (or list), or a contingency table from which the
          variables in `formula' should be taken.

  subset: an optional vector specifying a subset of observations to be
          used for plotting.

     ...: further graphics parameters (see 'par').

_A_u_t_h_o_r(_s):

     David Meyer
      david.meyer@ci.tuwien.ac.at

_R_e_f_e_r_e_n_c_e_s:

     H. Riedwyl & M. Schpbach (1994), Parquet diagram to plot
     contingency tables. In F. Faulbaum (ed.), _Softstat '93: Advances
     in Statistical Software_, 293-299. Gustav Fischer, New York.

     M. Friendly (2000), Visualizing Categorical Data, SAS Institute,
     Cary, NC.

_S_e_e _A_l_s_o:

     'mosaicplot'

_E_x_a_m_p_l_e_s:

     data(HairEyeColor)

     ## aggregate over `sex':
     (tab <- margin.table(HairEyeColor, c(2,1)))

     ## plot expected values:
     sieveplot(tab, type = "expected", values = "both")

     ## plot sieve diagram:
     sieveplot(tab)

     ## an example for the formula interface:
     data(VisualAcuity)
     sieveplot(Freq ~ right + left,  data = VisualAcuity, reverse.y = FALSE)

