Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

DataReshapers

Guides

  • Data reshaping functions

Tech Notes

  • Data transformation workflows
  • Long form data transformation
  • Wide form data transformation

Symbols

  • CrossTabulate
  • CrossTabulationMatrixQ
  • CrossTensorate
  • CrossTensorateSplit
  • DatasetToMatrix
  • GridTableForm
  • LongFormDataset
  • PivotLonger
  • RecordsSummary
  • RecordsToLongFormDataset
  • RecordsToWideFormDataset
  • SeparateColumn
  • ToAutomaticKeysAssociation
  • TypeOfDataToBeReshaped
  • WideFormDataset
AntonAntonov`DataReshapers`
CrossTensorate
​
CrossTensorate[f,ds]
finds the contingency values in the data
ds
using the formula
f
.
​
Details and Options

Examples  
(2)
Basic Examples  
(1)
Here is a random dataset with 300 rows and 3 named columns:
In[1]:=
SeedRandom[8];​​ds=ResourceFunction["RandomTabularDataset"][{300,Characters["ABC"]},"Generators"{Characters["xyz"]}];​​ds[1;;4]
Out[1]=
Compute the contingency tensor:
In[2]:=
ct=
CrossTensorate
[Count"A"+"B"+"C",ds]
Out[2]=
XTABTensorSparseArray
Specified elements: 27
Dimensions: {3,3,3}
,A{x,y,z},B{x,y,z},C{x,y,z}
Here we show the tensor obtained above:
In[3]:=
MatrixForm[ct]
Out[3]//MatrixForm=
x
y
z
x
x
15
y
10
z
14
x
11
y
10
z
11
x
9
y
11
z
7
y
x
14
y
13
z
19
x
4
y
16
z
7
x
13
y
10
z
5
z
x
8
y
9
z
13
x
9
y
12
z
14
x
14
y
11
z
11
Applications  
(1)

SeeAlso
CrossTabulate
 
▪
CrossTensorateSplit
RelatedGuides
▪
Data reshaping functions
RelatedLinks
Anton Antonov,
Contingency tables creation examples
, (2016),
MathematicaForPrediction at WordPress
.
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com