showTable {CoCoRaw}R Documentation

The counts and fitted values of a marginal table

Description

Print on standard output the observed probabilities, counts, means, covariance matrix, canonical parameters, fitted values, residuals, etc. of marginal tables.

Usage

showTable(type = "observed", set = "*", model = FALSE, 
          random = FALSE, log.transformed = FALSE, complete = FALSE, 
          discrete.ordered = TRUE, table = FALSE, matrix = TRUE, 
          mixed = FALSE, output.form = "table", data = NULL, 
          object = .object.of.model(model, data = data, ...), ...)

Arguments

type A character string. The argument type for discrete variables: "counts", "probabilities", "expected", "unadjusted", "absolute", "f-res", "r-f", "g-res", "r-g", "adjusted", "c-res", "m-res", "standardized", "standard", "x-res", "l-res", "freeman-tukey", "sqrt", "power", "index", "zero", "error".
The argument type for both discrete and continuous variables: "leverage", "canonical", "gs", "hs", "ks", "moment", "means", "covariance", "raw", "total", "ss", "ssds", "determinants", "mk", "ms".
set A character string with the set of variables.
model See returnModel.
random Logical, if random then a random table with counts in the sufficient marginal tables as in the observed table is generated, and the values are are computed for this random table.
log.transformed Logical, if TRUE then the values are log.transformed before printed.
complete Logical, if complete is TRUE then no value is returned for cells to be zero by structure.
discrete.ordered Logical, if discrete.ordered then the variables are ordered as specified by the call.
table Logical, for CoCoCg objects. If table is FALSE then for each configuration in the cross classification of the discrete variables the means and covariances of the continuous variables are printed according to the argument matrix. If table is TRUE then for each mean and for each covariance a table formed by the cross classification of the discrete variables is printed with the quantity.
matrix Logical, for CoCoCg objects. If matrix is TRUE then the means and covariances are printed in a matrix with the continuous variables as headings, else all the quantities for the continuous variables are printed on a single line for each configuration in the cross classification of the discrete variables.
mixed Logical, if mixed is TRUE then mixed quantities are printed..
output.form A character string. The argument output.form is only used for only discrete variables: "table" for the table of the value selected by the argument type, "sparse.table" for a list of counts in cells with count different for zero, "case.list" for a case list, or, "list.all.values" for a list of all the values for discrete variables.
data See exportCoCo.
object See exportCoCo.
... Additional arguments to generate the CoCo object from the data argument. See propertyModel.

Details

Value

TRUE

Author(s)

Jens Henrik Badsberg

References

Badsberg, J.H.: A guide to CoCo, JSS, 2001 ( http://www.jstatsoft.org/v06/i04/ ) and Badsberg, J.H.: Xlisp+CoCo, Aalborg University, 1996.

See Also

summaryTable.

Examples

library(CoCoCg);
library(MASS)
data(crabs);

crabsCoCo <- makeCoCoCg();
result <- enterDataFrame(crabs[,-3], object = crabsCoCo);

enterModel("*;", object = crabsCoCo);

showTable("observed", "[:sp:sex]", object = crabsCoCo);

showTable("canonical", "[:sp:sex:FL:RW:CL:CW:BD]", 
                       matrix = TRUE, object = crabsCoCo);

showTable("canonical", "[:sp:sex:FL:RW:CL:CW:BD]", matrix = TRUE);

showTable("moment", "[:sp:sex:FL:RW:CL:CW:BD]", 
                       matrix = TRUE, object = crabsCoCo);

returnTable("canonical", "[:sp:sex:FL:RW:CL:CW:BD]");

returnTable("mk", "[:sp:sex:FL:RW:CL:CW:BD]");

# backward(recursive = TRUE, headlong = TRUE, coherent = TRUE, follow = TRUE, 
#          object = crabsCoCo);

m5 <- "[[:sp:sex]] / [[:sp:sex:FL][:sp:sex:RW][:sex:CL][:sp:sex:BD][:sp:sex:CW]] / [[:sex:FL:CL][:sp:sex:FL:CW][:sp:sex:FL:BD][:sp:sex:RW:CW][:sex:CL:CW][:sex:CL:BD][:sp:sex:CW:BD]]"
m4 <- "[[:sp:sex]] / [[:sp:sex:RW][:sp:sex:BD][:sp:sex:CW][:sp:sex:FL][:sex:CL]] / [[:sp:sex:CW:BD][:sex:CL:BD][:sex:CL:CW][:sp:sex:RW:BD][:sp:sex:RW:CW][:sp:sex:FL:BD][:sp:sex:FL:CW][:sex:FL:CL]]"
m3 <- "[[:sp:sex]] / [[:sp:sex:FL][:sp:sex:RW][:sex:CL][:sp:sex:BD][:sp:sex:CW]] / [[:sp:sex:FL:RW][:sex:FL:CL][:sp:sex:FL:CW][:sp:sex:FL:BD][:sp:sex:RW:CW][:sp:sex:RW:BD][:sex:CL:CW][:sex:CL:BD][:sp:sex:CW:BD]]"
m2 <- "[[:sp:sex]] / [[:sp:sex:BD][:sp:sex:CW][:sex:CL][:sp:sex:RW][:sp:sex:FL]] / [[:sp:sex:CW:BD][:sex:CL:BD][:sex:CL:CW][:sp:sex:RW:BD][:sp:sex:RW:CW][:sex:RW:CL][:sp:sex:FL:BD][:sp:sex:FL:CW][:sex:FL:CL][:sp:sex:FL:RW]]"
m1 <- "[[:sp:sex]] / [[:sp:sex:BD][:sp:sex:CW][:sp:sex:CL][:sp:sex:RW][:sp:sex:FL]] / [[:sp:sex:CW:BD][:sp:sex:CL:BD][:sp:sex:CL:CW][:sp:sex:RW:BD][:sp:sex:RW:CW][:sp:sex:RW:CL][:sp:sex:FL:BD][:sp:sex:FL:CW][:sp:sex:FL:CL][:sp:sex:FL:RW]]"

enterModel(m1, object = crabsCoCo);
enterModel(m2, object = crabsCoCo);
enterModel(m3, object = crabsCoCo);
enterModel(m4, object = crabsCoCo);
enterModel(m5, object = crabsCoCo);

makeCurrent("last", object = crabsCoCo)
returnTable("mk", "[:sp:sex:FL:RW:CL:CW:BD]");

Rfirst <- returnTable("mk", "[:sp:sex:FL:RW:CL:CW:BD]", model = 1);
Rlast  <- returnTable("mk", "[:sp:sex:FL:RW:CL:CW:BD]", model = 6);
Sfirst <- returnTable("ms", "[:sp:sex:FL:RW:CL:CW:BD]", model = 1);
Slast  <- returnTable("ms", "[:sp:sex:FL:RW:CL:CW:BD]", model = 6);

Rfirst$h-Rlast$h
Rfirst$K-Rlast$K
Sfirst$Mean-Slast$Mean

endCoCo(object = crabsCoCo);


[Package CoCoRaw version 0.1.6.5 Index]