Description Usage Arguments Value Author(s) References See Also Examples
Generates a matrix containing a contingency table for each row of a matrix and a vector of class labels.
1 | computeContClass(data, cl, n.cat)
|
data |
a numeric matrix consisting of integers between 1 and |
cl |
a numeric vector of length |
n.cat |
an integer giving the number of levels the variables can take. If not
specified, |
A list composed of the following two matrices:
mat.obs |
a matrix consisting of m rows and |
mat.exp |
a matrix of the same size as |
Holger Schwender, holger.schwender@udo.edu
Schwender, H.\ (2007). A Note on the Simultaneous Computation of Thousands of Pearson's ChiSquare-Statistics. Technical Report, SFB 475, Deparment of Statistics, University of Dortmund.
computeContCells
, rowChisqStats
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
# Generate an example data set consisting of 10 rows (variables)
# and 200 columns (observations) by randomly drawing integers
# between 1 and 3, and a vector of class labels of length 200
# indicating that the first 100 observation belong to class 1
# and the other 100 to class 2.
mat <- matrix(sample(3, 2000, TRUE), 10)
cl <- rep(1:2, e = 100)
# Applying computeContClass to this data set
out <- computeContClass(mat, cl)
# generates the observed numbers of observations
out$mat.obs
# and the corresponding expected numbers of observations.
out$mat.exp
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.