Ctable object (Multivariate Analysis Toolbox for MatlabŪ)

written by: Liran Carmel

Last modified: 14:55, Sun 12-Sep-2010

General Description
This object represents a contingency table. It inherits from the parent object vvmatrix.

Navigate to:     General Description     Class Structure     Class Construction     Class Functions

Class Structure
Each field can be accessed by the dot (.) operation, or by the GET function. The GET function can work on multiple instances simultaneously. Most fields, except for those that are Dependent, can be modified using the dot (.) operation, or by the SET function.
    Field Description Type Default Dedicated Get/Set Function  
    indices Indices of samples in each cell cell array {}    
    type Inherited from vvmatrix. Type of matrix. It is always 'variable-variable' string 'variable-variable'    
    row_units Inherited from vvmatrix. units of the row-variables. cell {}    
    row_level Inherited from vvmatrix. level of the row-variables. Can be nominal/ordinal/numerical/unknown cell {}    
    col_units Inherited from vvmatrix. units of the column-variables. cell {}    
    col_level Inherited from vvmatrix. level of the column-variables. Can be nominal/ordinal/numerical/unknown cell {}    
    is_square Inherited from vvmatrix. true if the row-variables are identical to the column-variable. logical false    
    name Inherited from datamatrix. name of object, should be short and used as identifier. This field will never be empty. string 'unnamed'    
    description Inherited from datamatrix. verbal description of the class content. string ''    
    source Inherited from datamatrix. verbal description of the source of information. string ''    
    row_name Inherited from datamatrix. Name of the row-category (for example, in gene arrays it can be "tissue"). string ''    
    row_sampleset Inherited from datamatrix. A sampleset describing the row-samples. sampleset []    
    row_groupings Inherited from datamatrix. grouping objects associated with the row-samples. grouping array []    
    col_name Inherited from datamatrix. Name of the column-category (for example, in gene arrays it can be "genes"). string ''    
    col_sampleset Inherited from datamatrix. A sampleset describing the column-samples. sampleset []    
    col_groupings Inherited from datamatrix. grouping objects associated with the column-samples. grouping array []    
    matrix Inherited from datamatrix. the data matrix. double []    
    transformations Inherited from datamatrix. keeping track on transformations that had been applied previously on the matrix. structure []    
  Dependent no_rows Inherited from datamatrix. number of row-samples. integer scalar 0 norows  
  Dependent no_cols Inherited from datamatrix. number of column-samples. integer scalar 0 nocols  

Class Construction
Empty instance (scalar)
an empty ctable instance, with all fields initialized to their default values.
syntax: ct = ctable;
Empty instance (matrix)
an array of empty ctable instances.
syntax: ct = ctable(size,'size');
Copy constructor
one ctable instance is copied into another.
syntax: ct_destination = ctable(ct_origin);
Construction by field names
an instance is formed by directly providing field values. Any field which is not dependent is permitted.
syntax: ct = ctable(field_name, field_value, ...);
Reading-in a table
an instance is formed by reading-in a contingency table.
syntax: ct = ctable(table);
Merging two GROUPING instances
Two grouping objects are used to split the data into a 2-by-2 ctable
syntax: ct = ctable(category_1, category_2);

List of Functions

Display:

show
displays class content. Source: datamatrix.

I/O functions:

xlswrite
writes VVMATRIX data into an excel sheet. Source: vvmatrix.

Inference:

testchi2
tests whether two categories are independent.

Information extraction:

colid
finds the IDs of a list of column-variables. Source: datamatrix.
rowid
finds the IDs of a list of row-variables. Source: datamatrix.

Operators:

deletecols
eliminate col-variables from a VVMATRIX instance. Source: vvmatrix.
deleterows
eliminate row-variables from a VVMATRIX instance. Source: vvmatrix.
deletevariables
eliminates variables from a square-form VVMATRIX. Source: vvmatrix.

SET/GET functions:

colnames
retrieves the column-variable names. Source: datamatrix.
get
get method
matrix
retrieves the variable-by-variable matrix. Source: vvmatrix.
nocols
retrieves the number of columns in DATAMATRIX instances. Source: datamatrix.
norows
retrieves the number of rows in DATAMATRIX instances. Source: datamatrix.
rownames
retrieves the row-variable names. Source: datamatrix.
set
set method