Create Crosstabulation

DESCRIPTION:

A crosstabulation is a collection of one or more two-way tables that is useful for understanding the distribution among the different factors in a data set. It displays counts of observations for all combinations of the levels in a set of factor variables.

This function requires the bigdata library section to be loaded.

USAGE:

bd.crosstabs(data, columns=NULL, na.action=<<see below>>, sort=T)

REQUIRED ARGUMENTS:

data
input data set: a bdFrame or data.frame.

OPTIONAL ARGUMENTS:

columns
names or numbers of columns to calculate the crosstabulation for. Defaults to all factor columns.
na.action
function for handling missing values. If there are any missing values in the data to be crosstabulated, the data will be passed to the function given by na.action. If data has an attribute na.action, that will be used as the default value. Alternatively, if options("na.action") is defined, it will be used as the default value. Otherwise, the default is na.fail, which issues a fatal error message describing the problem. Other common alternatives are na.exclude and na.include.
sort
if data is already sorted, setting this to FALSE allows you to skip the sort step.

VALUE:

an object of class crosstabs, with the same structure as an object returned by the function . This is an array of counts, suitable for use in functions like loglin.

This object has an attribute marginals, a list of arrays of the marginal proportions. This is equal to the default marginal list produced by the function when its margin argument is not specified.

SEE ALSO:

EXAMPLES:

## Create a simple Crosstabulation
bd.crosstabs(guayule, 1:3)