statCount2D
The statCount2D
function creates a new plotting context with new dataset which contains the "count2D" statistic calculated on sample of a two categorical variable x and y. It counts the number of observations in each pair of x-category and y-category. It's weighted, it means the weighted count for each pair is calculated (each element within a pair is counted along with its weight).
Arguments
X
Type of x categories
Y
Type of y categories
x
Required
Iterable Column String
The x
argument is used to provide the sample (or its x-part) on which the statistic is computed.
y
Required
Iterable Column String
The y
argument is used to provide the y-part of the sample on which the statistic is computed.
weights
Optional
Iterable Column String
The weights
argument is used to provide the weights of sample elements.
Statistic properties
In this context, there are the following statistical properties that can be used to create mappings, customize tooltips, etc.
Stat.x
Column<X>
The Stat.x
contains x-part of categories.
Stat.y
Column<Y>
The Stat.x
contains y-part categories.
Stat.count
Column<Int>
The Stat.count
contains number of observations in this category (each one is specified by its x- and y- part)
Stat.countWeighted
Column<Double>
The Stat.countWeighted
contains weighted count (sum of weights in this category). Without weights
its values matches Stat.count
values.