crosstab
Cross-tabulation
Syntax
tbl = crosstab(x1,x2)
tbl = crosstab(x1,...,xn)
[tbl,chi2,p] = crosstab(___)
[tbl,chi2,p,labels] = crosstab(___)
Description
Examples
Input Arguments
Output Arguments
Algorithms
crosstab
usesgrp2idx
to assign a positive integer to each distinct value.tbl(i,j)
is a count of indices wheregrp2idx(x1)
isi
andgrp2idx(x2)
isj
. The numerical order ofgrp2idx(x1)
andgrp2idx(x2)
order rows and columns oftbl
, respectively.
In this case, the returned value oftbl(i,j,...,n)
is a count of indices wheregrp2idx(x1)
isi
,grp2idx(x2)
isj
,grp2idx(x3)
isk
, and so on.
Extended Capabilities
Introduced before R2006a
Was this topic helpful?