|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.stat.TableMultiWay
public class TableMultiWay
Tallies observations into a multi-way frequency table.
The TableMultiWay
class determines the distinct values in
multivariate data and computes frequencies for the data. This class
accepts the data in the matrix x
, but performs computations only
for the variables (columns) in the first nKeys
columns of x
or by
the variables specified in indkeys
. In general, the variables for
which frequencies should be computed are discrete; they should take
on a relatively small number of different values. Variables that are
continuous can be grouped first. TableMultiWay
can be used to group
variables and determine the frequencies of groups.
When method getBalancedTable
is called, the inner class
BalancedTable
fills the vector values with the unique values
in the vector of the variables and tallies the number of unique values of
each variable table. Each combination of one value from each variable forms a cell
in a multi-way table. The frequencies of these cells are entered in
a table so that the first variable cycles through its values exactly once,
and the last variable cycles through its values most rapidly. Some
cells cannot correspond to any observations in the data; in other
words, "missing cells" are included in table and have a value of 0.
The frequency table is returned by the BalancedTable
method
getTable
.
When method getUnbalancedTable
is called, an instance of inner
class UnbalancedTable
is created, the frequency of each cell is entered
in the unbalanced table so that the first variable cycles through its
values exactly once and the last variable cycles through its values
most rapidly. table
is returned by UnbalancedTable
method
getTable
. All cells have a frequency of at least 1, i.e., there
is no "missing cell." The array listCells
, returned by method
getListCells
can be considered "parallel"
to table
because row i of listCells
is the set of nKeys
values that describes the cell for which
row i of table
contains the corresponding frequency.
Nested Class Summary | |
---|---|
class |
TableMultiWay.BalancedTable
Tallies the number of unique values of each variable. |
class |
TableMultiWay.UnbalancedTable
Tallies the frequency of each cell in x . |
Field Summary | |
---|---|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
TableMultiWay(double[][] x,
int nKeys)
Constructor for TableMultiWay . |
|
TableMultiWay(double[][] x,
int[] indkeys)
Constructor for TableMultiWay . |
Method Summary | |
---|---|
TableMultiWay.BalancedTable |
getBalancedTable()
Returns an object containing the balanced table. |
int[] |
getGroups()
Returns the number of observations (rows) in each group. |
TableMultiWay.UnbalancedTable |
getUnbalancedTable()
Returns an object containing the unbalanced table. |
void |
setFrequencies(double[] frequencies)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public TableMultiWay(double[][] x, int nKeys)
TableMultiWay
.
x
- A double
matrix containing the
observations and variables.nKeys
- int
array containing the variables(columns)
for which computations are to be performed.public TableMultiWay(double[][] x, int[] indkeys)
TableMultiWay
.
x
- A double
matrix containing the
observations and variables.indkeys
- int
array containing the variables(columns)
for which computations are to be performed.Method Detail |
---|
public TableMultiWay.BalancedTable getBalancedTable()
TableBalanced object
.public int[] getGroups()
x
that are equal with
respect to the method of comparison.
If n
contains the returned integer array, then the first
n[0]
rows of the sorted x
are group number 1. The next
n[1]
rows of the sorted x
are group number 2, etc.
The last n[n.length - 1]
rows of the sorted x
are group
number n.length
.
int
array containing the number of observations (row)
in each group.public TableMultiWay.UnbalancedTable getUnbalancedTable()
TableUnBalanced object
.public void setFrequencies(double[] frequencies)
|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |