SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions

Functions

template<domain D>
D uint32 contingencyTable (D uint32[[1]] data, D bool[[1]] cases, D bool[[1]] controls, uint32[[2]] codeBook)
 
template<domain D>
D uint64 contingencyTable (D uint64[[1]] data, D bool[[1]] cases, D bool[[1]] controls, uint64[[2]] codeBook)
 

Detailed Description

Create a contingency table.

Note
D - all protection domains
Supported types - uint32 / uint64
Parameters
data- input vector
cases- vector indicating which elements of data belong to cases
controls- vector indicating which elements of data belong to controls
codeBook- matrix used for coding the answer. The first row contains expected values of the input vector and the second row contains the classes that these values will be put into. The classes should be consecutive and begin from 1.
Returns
returns a contingency table in the format
CasesControls
Option 1c1d1
Option 2c2d2
Option 3c3d3
Leakage
None

Function Documentation

◆ contingencyTable() [1/2]

D uint32 contingencyTable ( D uint32[[1]]  data,
D bool[[1]]  cases,
D bool[[1]]  controls,
uint32[[2]]  codeBook 
)

◆ contingencyTable() [2/2]

D uint64 contingencyTable ( D uint64[[1]]  data,
D bool[[1]]  cases,
D bool[[1]]  controls,
uint64[[2]]  codeBook 
)