diff --git a/src/cr/cube/enum.py b/src/cr/cube/enum.py
index 615692df6..0b1f51a0c 100644
--- a/src/cr/cube/enum.py
+++ b/src/cr/cube/enum.py
@@ -51,5 +51,5 @@ class DIMENSION_TYPE(object):
# ---allowed types for pairwise comparison---
ALLOWED_PAIRWISE_TYPES = frozenset(
- (BINNED_NUMERIC, CAT, CA_CAT, DATETIME, MR, TEXT)
+ (BINNED_NUMERIC, CA, CAT, CA_CAT, DATETIME, MR, TEXT)
)
diff --git a/tests/expectations/ca-subvar-x-cat-hs-pw-pvals.py b/tests/expectations/ca-subvar-x-cat-hs-pw-pvals.py
new file mode 100644
index 000000000..3e4250800
--- /dev/null
+++ b/tests/expectations/ca-subvar-x-cat-hs-pw-pvals.py
@@ -0,0 +1,5 @@
+[
+ [2.04087876e-01, 1.00000000e00, 5.61686813e-02, 5.61686813e-02, 5.83524533e-01],
+ [6.60280804e-01, 1.00000000e00, 3.87961906e-01, 5.61686813e-02, 8.51012165e-01],
+ [1.33519650e-01, 1.00000000e00, 7.95587544e-01, 8.48841390e-04, 6.61368183e-01],
+]
diff --git a/tests/expectations/ca-subvar-x-cat-hs-pw-tstats.py b/tests/expectations/ca-subvar-x-cat-hs-pw-tstats.py
new file mode 100644
index 000000000..a2a12187f
--- /dev/null
+++ b/tests/expectations/ca-subvar-x-cat-hs-pw-tstats.py
@@ -0,0 +1,5 @@
+[
+ [1.35873244, 0.0, -2.19089023, -2.19089023, 0.55829053],
+ [-0.45291081, 0.0, 0.90716763, -2.19089023, -0.19054822],
+ [-1.63299316, 0.0, 0.26686442, 4.89897949, -0.44536177],
+]
diff --git a/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-pvals.py b/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-pvals.py
new file mode 100644
index 000000000..2937eaa76
--- /dev/null
+++ b/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-pvals.py
@@ -0,0 +1,11 @@
+[
+ [9.76839276e-10, 1.00000000e00, 0.00000000e00],
+ [1.55431223e-14, 1.00000000e00, 0.00000000e00],
+ [1.28612265e-08, 1.00000000e00, 0.00000000e00],
+ [1.67441552e-01, 1.00000000e00, 3.96622408e-07],
+ [1.24942021e-01, 1.00000000e00, 1.51478682e-04],
+ [3.73949987e-04, 1.00000000e00, 0.00000000e00],
+ [2.49833210e-08, 1.00000000e00, 6.39580235e-08],
+ [8.23819611e-01, 1.00000000e00, 4.74757203e-02],
+ [2.91411313e-08, 1.00000000e00, 1.81814095e-08],
+]
diff --git a/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-tstats.py b/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-tstats.py
new file mode 100644
index 000000000..8301e7875
--- /dev/null
+++ b/tests/expectations/cat-hs-x-mr-wgtd-aug-pw-tstats.py
@@ -0,0 +1,11 @@
+[
+ [6.11927895, 0.0, -14.1303337],
+ [-7.69445366, 0.0, 12.49573404],
+ [5.69285527, 0.0, -11.74466913],
+ [1.38057613, 0.0, -5.07435061],
+ [-1.53449069, 0.0, 3.79025526],
+ [-3.55908594, 0.0, 9.3099453],
+ [-5.57805647, 0.0, 5.41192963],
+ [0.22264108, 0.0, 1.98230386],
+ [-5.55112327, 0.0, 5.63360373],
+]
diff --git a/tests/expectations/cat-x-cat-hs-pw-pvals.py b/tests/expectations/cat-x-cat-hs-pw-pvals.py
new file mode 100644
index 000000000..301d84b33
--- /dev/null
+++ b/tests/expectations/cat-x-cat-hs-pw-pvals.py
@@ -0,0 +1,41 @@
+[
+ [
+ 1.00000000e00,
+ 9.50744855e-01,
+ 7.61580875e-01,
+ 1.45494511e-03,
+ 1.35271514e-04,
+ 2.75262668e-03,
+ 9.40575477e-01,
+ 4.90755141e-01,
+ 3.16822332e-03,
+ 6.38672254e-01,
+ 3.44275537e-05,
+ ],
+ [
+ 1.00000000e00,
+ 2.34589189e-01,
+ 7.02082945e-01,
+ 8.84605265e-04,
+ 5.67562813e-04,
+ 5.94375533e-03,
+ 5.53862215e-01,
+ 3.88027539e-01,
+ 1.11098015e-02,
+ 2.71039211e-01,
+ 7.25442977e-04,
+ ],
+ [
+ 1.00000000e00,
+ 8.78852262e-02,
+ 3.51831360e-01,
+ 3.82131035e-01,
+ 8.03255937e-01,
+ 8.12841336e-01,
+ 3.31271828e-01,
+ 7.00272311e-01,
+ 9.68813218e-01,
+ 3.04581978e-01,
+ 8.43264694e-01,
+ ],
+]
diff --git a/tests/expectations/cat-x-cat-hs-pw-tstats.py b/tests/expectations/cat-x-cat-hs-pw-tstats.py
new file mode 100644
index 000000000..3ed26e948
--- /dev/null
+++ b/tests/expectations/cat-x-cat-hs-pw-tstats.py
@@ -0,0 +1,41 @@
+[
+ [
+ 0.0,
+ -0.06178448,
+ 0.30342874,
+ -3.18865018,
+ -3.82130608,
+ -2.99560531,
+ 0.07456344,
+ -0.68932699,
+ -2.95469238,
+ -0.46970468,
+ -4.14956044,
+ ],
+ [
+ 0.0,
+ 1.18922394,
+ 0.38254102,
+ 3.3306654,
+ 3.45013209,
+ 2.7520633,
+ 0.59216241,
+ 0.86352416,
+ 2.54171145,
+ 1.10130414,
+ 3.3839919,
+ ],
+ [
+ 0.0,
+ -1.7080666,
+ -0.931165,
+ -0.87419923,
+ -0.24915622,
+ -0.2367748,
+ -0.97198009,
+ -0.38504801,
+ -0.03910193,
+ -1.02720423,
+ 0.19773989,
+ ],
+]
diff --git a/tests/expectations/cat-x-cat-hs-scale-means-pw-pvals.py b/tests/expectations/cat-x-cat-hs-scale-means-pw-pvals.py
new file mode 100644
index 000000000..9a479f6b2
--- /dev/null
+++ b/tests/expectations/cat-x-cat-hs-scale-means-pw-pvals.py
@@ -0,0 +1,13 @@
+[
+ 1.00000000e00,
+ 4.80680137e-01,
+ 9.46191784e-01,
+ 3.31862965e-04,
+ 3.31301800e-05,
+ 1.10780471e-03,
+ 7.63968024e-01,
+ 4.02022180e-01,
+ 2.52958600e-03,
+ 3.91811876e-01,
+ 2.03020376e-05,
+]
diff --git a/tests/expectations/cat-x-cat-hs-scale-means-pw-tstats.py b/tests/expectations/cat-x-cat-hs-scale-means-pw-tstats.py
new file mode 100644
index 000000000..0f3ad20c8
--- /dev/null
+++ b/tests/expectations/cat-x-cat-hs-scale-means-pw-tstats.py
@@ -0,0 +1,13 @@
+[
+ 0.0,
+ -0.70543134,
+ -0.06749456,
+ -3.59627589,
+ -4.15672996,
+ -3.26353764,
+ -0.30034779,
+ -0.8383222,
+ -3.02379687,
+ -0.85672124,
+ -4.26974185,
+]
diff --git a/tests/expectations/cat-x-cat-pw-pvals.py b/tests/expectations/cat-x-cat-pw-pvals.py
new file mode 100644
index 000000000..de3b32f1a
--- /dev/null
+++ b/tests/expectations/cat-x-cat-pw-pvals.py
@@ -0,0 +1,12 @@
+[
+ [0.3543704462583741, 0.2854486628456121, 1],
+ [0.0137065536277976, 0.1450553643559893, 1],
+ [0.0000078991077082, 0.898495781851322, 1],
+ [0.4090774528587606, 0.2737382169902576, 1],
+ [0.0020173609289613, 0.9607993020139403, 1],
+ [0.0845124966799853, 0.6867680056298973, 1],
+ [0.5263071263993964, 0.8291359554655602, 1],
+ [0.093569693339443, 0.6366499668820378, 1],
+ [0.2390913772747494, 0.5068305468138976, 1],
+ [0.0001845038553001, 0.4693091017156237, 1],
+]
diff --git a/tests/expectations/cat-x-cat-pw-tstats.py b/tests/expectations/cat-x-cat-pw-tstats.py
new file mode 100644
index 000000000..4363f11ee
--- /dev/null
+++ b/tests/expectations/cat-x-cat-pw-tstats.py
@@ -0,0 +1,12 @@
+[
+ [0.926265419379764, -1.06821799614525, 0],
+ [2.46608073666841, 1.45733791450049, 0],
+ [4.47444356884568, -0.127565104025694, 0],
+ [-0.825615066069789, 1.09455611515513, 0],
+ [-3.08993537423754, 0.0491518359221346, 0],
+ [1.72556180249472, 0.403257023461294, 0],
+ [0.633715242008222, -0.215815666049458, 0],
+ [-1.67730697176792, -0.472402692576022, 0],
+ [1.17745694642709, 0.663805453182429, 0],
+ [-3.74325301090516, -0.723631945942289, 0],
+]
diff --git a/tests/expectations/cat-x-cat-wgtd-pw-indices.py b/tests/expectations/cat-x-cat-wgtd-pw-indices.py
new file mode 100644
index 000000000..3f700937d
--- /dev/null
+++ b/tests/expectations/cat-x-cat-wgtd-pw-indices.py
@@ -0,0 +1,7 @@
+[
+ [(), (), (), ()],
+ [(), (), (), ()],
+ [(), (), (), ()],
+ [(), (), (), ()],
+ [(2, 3), (), (), ()],
+]
diff --git a/tests/expectations/cat-x-cat-wgtd-pw-pvals.py b/tests/expectations/cat-x-cat-wgtd-pw-pvals.py
new file mode 100644
index 000000000..e73afff0c
--- /dev/null
+++ b/tests/expectations/cat-x-cat-wgtd-pw-pvals.py
@@ -0,0 +1,7 @@
+[
+ [1.0, 0.1673820620286901, 0.37579738470724267, 0.16373028998420036],
+ [1.0, 0.8493616019040273, 0.7575734897713429, 0.6903959137827367],
+ [1.0, 0.9700615941125716, 0.20566822638024163, 0.7160606992310101],
+ [1.0, 0.23747780923355655, 0.30821629616167123, 0.17970733830083074],
+ [1.0, 0.0839987707197456, 0.015862691173528676, 0.002723927327002773],
+]
diff --git a/tests/expectations/cat-x-cat-wgtd-pw-tstats.py b/tests/expectations/cat-x-cat-wgtd-pw-tstats.py
new file mode 100644
index 000000000..98b30d536
--- /dev/null
+++ b/tests/expectations/cat-x-cat-wgtd-pw-tstats.py
@@ -0,0 +1,7 @@
+[
+ [0.0, 1.3892930788974391, 0.8869425734660505, 1.402945620973322],
+ [0.0, 0.1903540333363253, 0.30894158244285624, 0.3994739596013725],
+ [0.0, 0.03761142927757482, 1.2682277741610029, 0.36476016345069556],
+ [0.0, -1.187392798652706, -1.0206496663686406, -1.35111583891054],
+ [0.0, -1.742783579889951, -2.425391682127969, -3.0738474093706927],
+]
diff --git a/tests/expectations/mr-subvar-x-mr-aug-pw-pvals.py b/tests/expectations/mr-subvar-x-mr-aug-pw-pvals.py
new file mode 100644
index 000000000..4310c612a
--- /dev/null
+++ b/tests/expectations/mr-subvar-x-mr-aug-pw-pvals.py
@@ -0,0 +1,4 @@
+[
+ [1.00000000e00, 0.00000000e00, 0.00000000e00],
+ [1.00000000e00, 5.42792478e-11, 0.00000000e00],
+]
diff --git a/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab1.py b/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab1.py
new file mode 100644
index 000000000..f047bc6b6
--- /dev/null
+++ b/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab1.py
@@ -0,0 +1,5 @@
+[
+ [0.82707248, 0.86881078, 0.56294105],
+ [0.86881078, 0.85960427, 0.61504991],
+ [0.56294105, 0.61504991, 0.63206628],
+]
diff --git a/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab2.py b/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab2.py
new file mode 100644
index 000000000..54c974b65
--- /dev/null
+++ b/tests/expectations/mr-subvar-x-mr-aug-pw-shadow-proportions-tab2.py
@@ -0,0 +1,5 @@
+[
+ [0.17292752, 0.13118922, 0.43705895],
+ [0.13118922, 0.14039573, 0.38495009],
+ [0.43705895, 0.38495009, 0.36793372],
+]
diff --git a/tests/expectations/mr-subvar-x-mr-aug-pw-tstats.py b/tests/expectations/mr-subvar-x-mr-aug-pw-tstats.py
new file mode 100644
index 000000000..315d54d70
--- /dev/null
+++ b/tests/expectations/mr-subvar-x-mr-aug-pw-tstats.py
@@ -0,0 +1 @@
+[[0.0, 16.02651373, -22.43766743], [0.0, -6.56624439, 29.71952066]]
diff --git a/tests/expectations/mr-x-mr-pw-pvals.py b/tests/expectations/mr-x-mr-pw-pvals.py
new file mode 100644
index 000000000..ec0761065
--- /dev/null
+++ b/tests/expectations/mr-x-mr-pw-pvals.py
@@ -0,0 +1,7 @@
+[
+ [0.42416402, 1.0, 0.02645888],
+ [0.54427888, 1.0, 0.03130077],
+ [0.23018433, 1.0, 0.88480775],
+ [0.11149176, 1.0, 0.66689419],
+ [0.08853052, 1.0, 0.12423633],
+]
diff --git a/tests/expectations/mr-x-mr-pw-tstats.py b/tests/expectations/mr-x-mr-pw-tstats.py
new file mode 100644
index 000000000..9c99ba475
--- /dev/null
+++ b/tests/expectations/mr-x-mr-pw-tstats.py
@@ -0,0 +1,7 @@
+[
+ [-0.80066287, 0.0, -2.22179624],
+ [-0.60726974, 0.0, -2.1554303],
+ [1.203117, 0.0, 0.14490412],
+ [1.59774062, 0.0, 0.43050695],
+ [-1.71054946, 0.0, 1.53817055],
+]
diff --git a/tests/expectations/mr-x-mr-wgtd-aug-pw-pvals.py b/tests/expectations/mr-x-mr-wgtd-aug-pw-pvals.py
new file mode 100644
index 000000000..bb47df1db
--- /dev/null
+++ b/tests/expectations/mr-x-mr-wgtd-aug-pw-pvals.py
@@ -0,0 +1,7 @@
+[
+ [0.0, 1.00000000e00, 0.0],
+ [0.0, 1.00000000e00, 0.0],
+ [1.19015908e-13, 1.00000000e00, 1.94264286e-02],
+ [0.0, 1.00000000e00, 0.0],
+ [3.35015757e-02, 1.00000000e00, 0.0],
+]
diff --git a/tests/expectations/mr-x-mr-wgtd-aug-pw-tstats.py b/tests/expectations/mr-x-mr-wgtd-aug-pw-tstats.py
new file mode 100644
index 000000000..acda02218
--- /dev/null
+++ b/tests/expectations/mr-x-mr-wgtd-aug-pw-tstats.py
@@ -0,0 +1,7 @@
+[
+ [-10.2964264, 0.0, -20.09577285],
+ [-16.38251357, 0.0, -28.57841019],
+ [-7.42875194, 0.0, 2.33766663],
+ [-10.88338158, 0.0, -22.45002834],
+ [-2.12632668, 0.0, -11.07466431],
+]
diff --git a/tests/fixtures/ca-subvar-hs-x-mr-augmented.json b/tests/fixtures/ca-subvar-hs-x-mr-augmented.json
index 606d2aa68..c8108f603 100644
--- a/tests/fixtures/ca-subvar-hs-x-mr-augmented.json
+++ b/tests/fixtures/ca-subvar-hs-x-mr-augmented.json
@@ -1,1947 +1,1904 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F5a782ff250164066b465d3e56897b269%2Fvariables%2F5LKrMtLGwhNM34xJpJxCaP000031%2Fsubvariables%2F0019%2F%22%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F5a782ff250164066b465d3e56897b269%2Fvariables%2F5LKrMtLGwhNM34xJpJxCaP000033%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F5a782ff250164066b465d3e56897b269%2Fvariables%2F5LKrMtLGwhNM34xJpJxCaP000033%2F%22%7D%5D%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F5a782ff250164066b465d3e56897b269%2Fvariables%2F5LKrMtLGwhNM34xJpJxCaP000033%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F5a782ff250164066b465d3e56897b269%2Fvariables%2F5LKrMtLGwhNM34xJpJxCaP000033%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000031/subvariables/0019/"
},
- "dimensions": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000031/subvariables/0019/"
- },
- {
- "function": "dimension",
- "args": [
- {
- "function": "as_selected",
- "args": [
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ }
+ },
+ "result": {
+ "counts": [
+ 44,
+ 0,
+ 0,
+ 3,
+ 1,
+ 40,
+ 0,
+ 1,
+ 43,
+ 0,
+ 0,
+ 44,
+ 0,
+ 8,
+ 0,
+ 0,
+ 8,
+ 0,
+ 8,
+ 0,
+ 0,
+ 0,
+ 0,
+ 8,
+ 0,
+ 0,
+ 369,
+ 31,
+ 0,
+ 338,
+ 338,
+ 0,
+ 31,
+ 0,
+ 0,
+ 369,
+ 3,
+ 0,
+ 31,
+ 34,
+ 0,
+ 0,
+ 0,
+ 0,
+ 34,
+ 0,
+ 0,
+ 34,
+ 1,
+ 8,
+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column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
{
- "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ "anchor": "top",
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "t1"
}
]
+ }
+ }
+ },
+ "type": {
+ "categories": [
+ {
+ "_id": 0,
+ "id": 1,
+ "missing": false,
+ "name": "selected",
+ "numeric_value": 1
+ },
+ {
+ "_id": 1,
+ "id": 2,
+ "missing": false,
+ "name": "not selected",
+ "numeric_value": 2
},
{
- "value": "subvariables"
+ "_id": 2,
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": 32766
+ },
+ {
+ "_id": 3,
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": 32767
+ },
+ {
+ "_id": -1,
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
}
- ]
- },
- {
- "function": "as_selected",
- "args": [
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "countries",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
+ },
+ {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ },
+ {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
}
- ]
+ ],
+ "uniform_basis": false
},
- {
- "function": "dimension",
- "args": [
+ "type": {
+ "class": "enum",
+ "elements": [
{
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0027",
+ "references": {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
}
- ]
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0028",
+ "references": {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ }
+ }
},
{
- "value": "subvariables"
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0029",
+ "references": {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ }
+ }
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "002a",
+ "references": {
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
+ }
+ }
}
- ]
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "countries",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
+ },
+ {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ },
+ {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ },
+ {
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
+ }
+ ],
+ "uniform_basis": false
},
- {
- "function": "as_selected",
- "args": [
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/5a782ff250164066b465d3e56897b269/variables/5LKrMtLGwhNM34xJpJxCaP000033/"
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
}
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0027",
+ "0028",
+ "0029",
+ "002a"
]
}
- ],
- "weight": null
- },
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "france",
- "description": "france",
- "name": "multrace_1",
- "view": {
- "show_counts": false,
- "column_width": null,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "t1",
- "anchor": "top"
- }
- ]
- },
- "include_missing": false,
- "show_numeric_values": false
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "countries",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
+ },
+ {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ },
+ {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ },
+ {
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
}
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "_id": 0,
- "id": 1,
- "missing": false,
- "name": "selected"
- },
- {
- "numeric_value": 2,
- "_id": 1,
- "id": 2,
- "missing": false,
- "name": "not selected"
- },
- {
- "numeric_value": 32766,
- "_id": 2,
- "id": 32766,
- "missing": true,
- "name": "skipped"
- },
- {
- "numeric_value": 32767,
- "_id": 3,
- "id": 32767,
- "missing": true,
- "name": "not asked"
- },
- {
- "numeric_value": null,
- "_id": -1,
- "id": -1,
- "missing": true,
- "name": "No Data"
- }
- ]
- }
+ ],
+ "uniform_basis": false
},
- {
- "references": {
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0027",
+ "references": {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
+ }
}
- ],
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "name": "countries",
- "alias": "countries"
- },
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- "id": "0027"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- "id": "0028"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- "id": "0029"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
- },
- "id": "002a"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": true,
- "references": {
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
- }
- ],
- "uniform_basis": false,
- "alias": "countries",
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "name": "countries"
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0027",
- "0028",
- "0029",
- "002a"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "name": "Selected",
- "missing": false
- },
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Other",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- },
- {
- "references": {
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0028",
+ "references": {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ }
}
- ],
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "name": "countries",
- "alias": "countries"
- },
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- "id": "0027"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- "id": "0028"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- "id": "0029"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
- },
- "id": "002a"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": true,
- "references": {
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "union_hhold_1",
- "description": "eurasia"
- },
- {
- "alias": "oceania",
- "name": "union_hhold_2",
- "description": "oceania"
- },
- {
- "alias": "eastasia",
- "name": "union_hhold_3",
- "description": "eastasia"
- },
- {
- "alias": "disputed",
- "name": "Disputed",
- "description": "disputed"
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0029",
+ "references": {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ }
}
- ],
- "uniform_basis": false,
- "alias": "countries",
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "name": "countries"
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0027",
- "0028",
- "0029",
- "002a"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "name": "Selected",
- "missing": false
- },
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Other",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "002a",
+ "references": {
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
+ }
}
- ]
+ }
+ ],
+ "subtype": {
+ "class": "variable"
}
}
- ],
- "missing": 1089,
- "measures": {
- "count": {
- "data": [
- 44,
- 0,
- 0,
- 3,
- 1,
- 40,
- 0,
- 1,
- 43,
- 0,
- 0,
- 44,
- 0,
- 8,
- 0,
- 0,
- 8,
- 0,
- 8,
- 0,
- 0,
- 0,
- 0,
- 8,
- 0,
- 0,
- 369,
- 31,
- 0,
- 338,
- 338,
- 0,
- 31,
- 0,
- 0,
- 369,
- 3,
- 0,
- 31,
- 34,
- 0,
- 0,
- 0,
- 0,
- 34,
- 0,
- 0,
- 34,
- 1,
- 8,
- 0,
- 0,
- 9,
- 0,
- 8,
- 1,
- 0,
- 0,
- 0,
- 9,
- 40,
- 0,
- 338,
- 0,
- 0,
- 378,
- 338,
- 0,
- 40,
- 0,
- 0,
- 378,
- 0,
- 8,
- 338,
- 0,
- 8,
- 338,
- 346,
- 0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
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "countries",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "eurasia",
+ "name": "union_hhold_1"
+ },
+ {
+ "alias": "oceania",
+ "description": "oceania",
+ "name": "union_hhold_2"
+ },
+ {
+ "alias": "eastasia",
+ "description": "eastasia",
+ "name": "union_hhold_3"
+ },
+ {
+ "alias": "disputed",
+ "description": "disputed",
+ "name": "Disputed"
+ }
],
- "n_missing": 1089,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
+ "uniform_basis": false
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
}
- }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0027",
+ "0028",
+ "0029",
+ "002a"
+ ]
}
- },
- "n": 1512,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 1452,
- "other": 150,
- "missing": 60
- },
- "weighted": {
- "selected": 1452,
- "other": 150,
- "missing": 60
+ }
+ ],
+ "measures": {
+ "count": {
+ "data": [
+ 44,
+ 0,
+ 0,
+ 3,
+ 1,
+ 40,
+ 0,
+ 1,
+ 43,
+ 0,
+ 0,
+ 44,
+ 0,
+ 8,
+ 0,
+ 0,
+ 8,
+ 0,
+ 8,
+ 0,
+ 0,
+ 0,
+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,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
}
},
- "filtered": {
- "unweighted": {
- "selected": 1512,
- "other": 150,
- "missing": 0
- },
- "weighted": {
- "selected": 1512,
- "other": 150,
- "missing": 0
- }
- }
- },
- "unfiltered": {
- "unweighted_n": 1662,
- "weighted_n": 1662
- },
- "filtered": {
- "unweighted_n": 1512,
- "weighted_n": 1512
- },
- "counts": [
- 44,
- 0,
- 0,
- 3,
- 1,
- 40,
- 0,
- 1,
- 43,
- 0,
- 0,
- 44,
- 0,
- 8,
- 0,
- 0,
- 8,
- 0,
- 8,
- 0,
- 0,
- 0,
- 0,
- 8,
- 0,
- 0,
- 369,
- 31,
- 0,
- 338,
- 338,
- 0,
- 31,
- 0,
- 0,
- 369,
- 3,
- 0,
- 31,
- 34,
- 0,
- 0,
- 0,
- 0,
- 34,
- 0,
- 0,
- 34,
- 1,
- 8,
- 0,
- 0,
- 9,
- 0,
- 8,
- 1,
- 0,
- 0,
- 0,
- 9,
- 40,
- 0,
- 338,
- 0,
- 0,
- 378,
- 338,
- 0,
- 40,
- 0,
- 0,
- 378,
- 0,
- 8,
- 338,
- 0,
- 8,
- 338,
- 346,
- 0,
- 0,
- 0,
- 0,
- 346,
- 1,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 1,
- 43,
- 0,
- 31,
- 34,
- 0,
- 40,
- 0,
- 0,
- 74,
- 0,
- 0,
- 74,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-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
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 94,
- 109,
- 886,
- 101,
- 105,
- 883,
- 902,
- 31,
- 156,
- 0,
- 0,
- 1089,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ "n_missing": 1089
+ }
+ },
+ "missing": 1089,
+ "n": 1512
}
}
\ No newline at end of file
diff --git a/tests/fixtures/ca-subvar-x-ca-cat-x-mr.json b/tests/fixtures/ca-subvar-x-ca-cat-x-mr.json
index 076e3e549..e72e61be7 100644
--- a/tests/fixtures/ca-subvar-x-ca-cat-x-mr.json
+++ b/tests/fixtures/ca-subvar-x-ca-cat-x-mr.json
@@ -1,624 +1,612 @@
{
- "element": "shoji:view",
- "self": "/api/datasets/123/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22/api/datasets/123%2Fvariables%2F00000f%2F%22%7D,%7B%22variable%22:%22/api/datasets/123%2Fvariables%2F00000f%2F%22%7D,%7B%22each%22:%22/api/datasets/123%2Fvariables%2F000010%2F%22%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22/api/datasets/123%2Fvariables%2F000010%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22/api/datasets/123%2Fvariables%2F00000d%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
- }
+ "query": {
+ "measures": {
+ "count": {
+ "function": "cube_count",
+ "args": [
+ ]
+ }
+ },
+ "dimensions": [
+ {
+ "each": "/api/datasets/123/variables/00000f/"
+ },
+ {
+ "variable": "/api/datasets/123/variables/00000f/"
+ },
+ {
+ "each": "/api/datasets/123/variables/000010/"
+ },
+ {
+ "function": "as_selected",
+ "args": [
+ {
+ "variable": "/api/datasets/123/variables/000010/"
+ }
+ ]
+ }
+ ],
+ "weight": "/api/datasets/123/variables/00000d/"
+ },
+ "result": {
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "subreferences": [
+ {
+ "alias": "a_cat",
+ "name": "cat",
+ "description": "a_cat"
+ },
+ {
+ "alias": "a_dog",
+ "name": "dog",
+ "description": "a_dog"
+ },
+ {
+ "alias": "a_wombat",
+ "name": "wombat",
+ "description": "a_wombat"
},
- "dimensions": [
+ {
+ "uniform_basis": null,
+ "description": null,
+ "name": "tarantula",
+ "format": null,
+ "subreferences": null,
+ "notes": null,
+ "api_derivation": null,
+ "dichotomous": false,
+ "discarded": null,
+ "alias": "tarantula",
+ "view": null
+ }
+ ],
+ "view": {
+ "show_counts": false,
+ "transforms": {
+ "insertions": [
{
- "each": "/api/datasets/123/variables/00000f/"
+ "function": "subtotal",
+ "args": [
+ 2
+ ],
+ "anchor": 2,
+ "name": "selected, again"
+ }
+ ]
+ },
+ "include_missing": false,
+ "column_width": null
+ },
+ "name": "pets_array",
+ "alias": "pets_array"
+ },
+ "type": {
+ "subtype": {
+ "class": "variable"
+ },
+ "elements": [
+ {
+ "id": 1,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "a_cat",
+ "name": "cat",
+ "description": "a_cat"
},
- {
- "variable": "/api/datasets/123/variables/00000f/"
+ "id": "0004"
+ },
+ "missing": false
+ },
+ {
+ "id": 2,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "a_dog",
+ "name": "dog",
+ "description": "a_dog"
},
- {
- "each": "/api/datasets/123/variables/000010/"
+ "id": "0005"
+ },
+ "missing": false
+ },
+ {
+ "id": 3,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "a_wombat",
+ "name": "wombat",
+ "description": "a_wombat"
},
+ "id": "0006"
+ },
+ "missing": false
+ },
+ {
+ "id": 4,
+ "value": {
+ "derived": false,
+ "references": {
+ "uniform_basis": null,
+ "description": null,
+ "name": "tarantula",
+ "format": null,
+ "subreferences": null,
+ "notes": null,
+ "api_derivation": null,
+ "dichotomous": false,
+ "discarded": null,
+ "alias": "tarantula",
+ "view": null
+ },
+ "id": "f624a951fedf4eeb86774ea84142c043"
+ },
+ "missing": false
+ }
+ ],
+ "class": "enum"
+ }
+ },
+ {
+ "references": {
+ "subreferences": [
+ {
+ "alias": "a_cat",
+ "name": "cat",
+ "description": "a_cat"
+ },
+ {
+ "alias": "a_dog",
+ "name": "dog",
+ "description": "a_dog"
+ },
+ {
+ "alias": "a_wombat",
+ "name": "wombat",
+ "description": "a_wombat"
+ },
+ {
+ "uniform_basis": null,
+ "description": null,
+ "format": null,
+ "subreferences": null,
+ "notes": null,
+ "api_derivation": null,
+ "dichotomous": false,
+ "discarded": null,
+ "alias": "tarantula",
+ "view": null,
+ "name": "tarantula"
+ }
+ ],
+ "alias": "pets_array",
+ "name": "pets_array",
+ "view": {
+ "show_counts": false,
+ "transforms": {
+ "insertions": [
{
- "function": "as_selected",
- "args": [
- {
- "variable": "/api/datasets/123/variables/000010/"
- }
- ]
+ "function": "subtotal",
+ "args": [
+ 2
+ ],
+ "anchor": 2,
+ "name": "selected, again"
}
- ],
- "weight": "/api/datasets/123/variables/00000d/"
+ ]
+ },
+ "include_missing": false,
+ "column_width": null
+ }
},
- "query_environment": {
- "filter": [
-
- ]
+ "derived": false,
+ "type": {
+ "ordinal": false,
+ "subvariables": [
+ "0004",
+ "0005",
+ "0006",
+ "f624a951fedf4eeb86774ea84142c043"
+ ],
+ "class": "categorical",
+ "categories": [
+ {
+ "numeric_value": 1,
+ "missing": false,
+ "id": 1,
+ "name": "not selected"
+ },
+ {
+ "numeric_value": 2,
+ "missing": false,
+ "id": 2,
+ "name": "selected"
+ },
+ {
+ "numeric_value": null,
+ "missing": true,
+ "id": -1,
+ "name": "No Data"
+ }
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "languages",
+ "subreferences": [
+ {
+ "alias": "Python",
+ "name": "Python",
+ "description": "Python"
+ },
+ {
+ "alias": "R",
+ "name": "R",
+ "description": "R"
+ },
+ {
+ "alias": "JavaScript",
+ "name": "JavaScript",
+ "description": "JavaScript"
+ }
+ ],
+ "is_dichotomous": false,
+ "description": "Languages",
+ "name": "languages"
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "subreferences": [
- {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- },
- {
- "uniform_basis": null,
- "description": null,
- "name": "tarantula",
- "format": null,
- "subreferences": null,
- "notes": null,
- "api_derivation": null,
- "dichotomous": false,
- "discarded": null,
- "alias": "tarantula",
- "view": null
- }
- ],
- "view": {
- "show_counts": false,
- "transforms": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 2
- ],
- "anchor": 2,
- "name": "selected, again"
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- },
- "name": "pets_array",
- "alias": "pets_array"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- "id": "0004"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- "id": "0005"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- },
- "id": "0006"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "uniform_basis": null,
- "description": null,
- "name": "tarantula",
- "format": null,
- "subreferences": null,
- "notes": null,
- "api_derivation": null,
- "dichotomous": false,
- "discarded": null,
- "alias": "tarantula",
- "view": null
- },
- "id": "f624a951fedf4eeb86774ea84142c043"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
+ "type": {
+ "subtype": {
+ "class": "variable"
+ },
+ "elements": [
+ {
+ "id": 1,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "Python",
+ "name": "Python",
+ "description": "Python"
},
- {
- "references": {
- "subreferences": [
- {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- },
- {
- "uniform_basis": null,
- "description": null,
- "format": null,
- "subreferences": null,
- "notes": null,
- "api_derivation": null,
- "dichotomous": false,
- "discarded": null,
- "alias": "tarantula",
- "view": null,
- "name": "tarantula"
- }
- ],
- "alias": "pets_array",
- "name": "pets_array",
- "view": {
- "show_counts": false,
- "transforms": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 2
- ],
- "anchor": 2,
- "name": "selected, again"
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "subvariables": [
- "0004",
- "0005",
- "0006",
- "f624a951fedf4eeb86774ea84142c043"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "not selected"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "selected"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
+ "id": "0007"
+ },
+ "missing": false
+ },
+ {
+ "id": 2,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "R",
+ "name": "R",
+ "description": "R"
},
- {
- "derived": true,
- "references": {
- "alias": "languages",
- "subreferences": [
- {
- "alias": "Python",
- "name": "Python",
- "description": "Python"
- },
- {
- "alias": "R",
- "name": "R",
- "description": "R"
- },
- {
- "alias": "JavaScript",
- "name": "JavaScript",
- "description": "JavaScript"
- }
- ],
- "is_dichotomous": false,
- "description": "Languages",
- "name": "languages"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "Python",
- "name": "Python",
- "description": "Python"
- },
- "id": "0007"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "R",
- "name": "R",
- "description": "R"
- },
- "id": "0008"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "JavaScript",
- "name": "JavaScript",
- "description": "JavaScript"
- },
- "id": "0009"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
+ "id": "0008"
+ },
+ "missing": false
+ },
+ {
+ "id": 3,
+ "value": {
+ "derived": false,
+ "references": {
+ "alias": "JavaScript",
+ "name": "JavaScript",
+ "description": "JavaScript"
},
- {
- "references": {
- "alias": "languages",
- "is_dichotomous": false,
- "description": "Languages",
- "name": "languages",
- "subreferences": [
- {
- "alias": "Python",
- "name": "Python",
- "description": "Python"
- },
- {
- "alias": "R",
- "name": "R",
- "description": "R"
- },
- {
- "alias": "JavaScript",
- "name": "JavaScript",
- "description": "JavaScript"
- }
- ]
- },
- "derived": true,
- "type": {
- "ordinal": false,
- "subvariables": [
- "0007",
- "0008",
- "0009"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Not Selected"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 11,
- "measures": {
- "count": {
- "data": [
- 48.3060552084168,
- 66.9213862845193,
- 0,
- 4,
- 111.227441492936,
- 0,
- 67.2009605786221,
- 48.026480914314,
- 0,
- 45.5622240626441,
- 43.0189195835338,
- 0,
- 88.581143646178,
- 0,
- 0,
- 46.0586810267601,
- 42.5224626194179,
- 0,
- 37.7333933396404,
- 16.2484218226594,
- 0,
- 33.1195045629724,
- 20.8623105993273,
- 0,
- 22.0856203922224,
- 31.8961947700774,
- 0,
- 0,
- 107.343646011268,
- 0,
- 44.5990866109926,
- 62.7445594002749,
- 0,
- 65.1772181069687,
- 42.1664279042988,
- 0,
- 99.2814207226147,
- 4,
- 0,
- 46.2762920148788,
- 57.0051287077359,
- 0,
- 47.3984636199024,
- 55.8829571027123,
- 0,
- 32.3202518880865,
- 14.845081679445,
- 0,
- 34.825269583279,
- 12.3400639842526,
- 0,
- 22.7695802707335,
- 24.3957532967981,
- 0,
- 38.467089744086,
- 37.7917070370835,
- 0,
- 34.9176266266032,
- 41.3411701545663,
- 0,
- 0,
- 76.2587967811695,
- 0,
- 40.2191314923054,
- 68.5784068160317,
- 0,
- 43.7410619590204,
- 65.0564763493167,
- 0,
- 104.797538308337,
- 4,
- 0,
- 52.9154513743098,
- 19.8186138375973,
- 0,
- 47.0419596235268,
- 25.6921055883804,
- 0,
- 30.5477236892674,
- 42.1863415226398,
- 0,
- 0,
- 4,
- 0,
- 4,
- 0,
- 0,
- 0,
- 4,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 131.601672610701,
- 122.188727690713,
- 0,
- 121.70064820915,
- 132.089752092263,
- 0,
- 135.345261997604,
- 118.445138303809,
- 0
- ],
- "n_missing": 11,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
- }
+ "id": "0009"
+ },
+ "missing": false
+ }
+ ],
+ "class": "enum"
+ }
+ },
+ {
+ "references": {
+ "alias": "languages",
+ "is_dichotomous": false,
+ "description": "Languages",
+ "name": "languages",
+ "subreferences": [
+ {
+ "alias": "Python",
+ "name": "Python",
+ "description": "Python"
+ },
+ {
+ "alias": "R",
+ "name": "R",
+ "description": "R"
+ },
+ {
+ "alias": "JavaScript",
+ "name": "JavaScript",
+ "description": "JavaScript"
+ }
+ ]
+ },
+ "derived": true,
+ "type": {
+ "ordinal": false,
+ "subvariables": [
+ "0007",
+ "0008",
+ "0009"
+ ],
+ "class": "categorical",
+ "categories": [
+ {
+ "numeric_value": 1,
+ "selected": true,
+ "id": 1,
+ "missing": false,
+ "name": "Selected"
+ },
+ {
+ "numeric_value": 0,
+ "missing": false,
+ "id": 0,
+ "name": "Not Selected"
+ },
+ {
+ "numeric_value": null,
+ "missing": true,
+ "id": -1,
+ "name": "No Data"
+ }
+ ]
+ }
+ }
+ ],
+ "missing": 11,
+ "measures": {
+ "count": {
+ "data": [
+ 48.3060552084168,
+ 66.9213862845193,
+ 0,
+ 4,
+ 111.227441492936,
+ 0,
+ 67.2009605786221,
+ 48.026480914314,
+ 0,
+ 45.5622240626441,
+ 43.0189195835338,
+ 0,
+ 88.581143646178,
+ 0,
+ 0,
+ 46.0586810267601,
+ 42.5224626194179,
+ 0,
+ 37.7333933396404,
+ 16.2484218226594,
+ 0,
+ 33.1195045629724,
+ 20.8623105993273,
+ 0,
+ 22.0856203922224,
+ 31.8961947700774,
+ 0,
+ 0,
+ 107.343646011268,
+ 0,
+ 44.5990866109926,
+ 62.7445594002749,
+ 0,
+ 65.1772181069687,
+ 42.1664279042988,
+ 0,
+ 99.2814207226147,
+ 4,
+ 0,
+ 46.2762920148788,
+ 57.0051287077359,
+ 0,
+ 47.3984636199024,
+ 55.8829571027123,
+ 0,
+ 32.3202518880865,
+ 14.845081679445,
+ 0,
+ 34.825269583279,
+ 12.3400639842526,
+ 0,
+ 22.7695802707335,
+ 24.3957532967981,
+ 0,
+ 38.467089744086,
+ 37.7917070370835,
+ 0,
+ 34.9176266266032,
+ 41.3411701545663,
+ 0,
+ 0,
+ 76.2587967811695,
+ 0,
+ 40.2191314923054,
+ 68.5784068160317,
+ 0,
+ 43.7410619590204,
+ 65.0564763493167,
+ 0,
+ 104.797538308337,
+ 4,
+ 0,
+ 52.9154513743098,
+ 19.8186138375973,
+ 0,
+ 47.0419596235268,
+ 25.6921055883804,
+ 0,
+ 30.5477236892674,
+ 42.1863415226398,
+ 0,
+ 0,
+ 4,
+ 0,
+ 4,
+ 0,
+ 0,
+ 0,
+ 4,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 131.601672610701,
+ 122.188727690713,
+ 0,
+ 121.70064820915,
+ 132.089752092263,
+ 0,
+ 135.345261997604,
+ 118.445138303809,
+ 0
+ ],
+ "n_missing": 11,
+ "metadata": {
+ "references": {
+ },
+ "derived": true,
+ "type": {
+ "integer": false,
+ "missing_rules": {
+ },
+ "missing_reasons": {
+ "No Data": -1
},
- "element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
+ 0,
+ 38,
+ 2,
+ 0,
+ 17,
+ 13,
+ 0,
+ 18,
+ 12,
+ 0,
+ 13,
+ 17,
+ 0,
+ 0,
+ 2,
+ 0,
+ 2,
+ 0,
+ 0,
+ 0,
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 51,
+ 49,
+ 0,
+ 47,
+ 53,
+ 0,
+ 51,
+ 49,
+ 0
+ ],
+ "n": 102
+ }
}
diff --git a/tests/fixtures/ca-subvar-x-cat-hs.json b/tests/fixtures/ca-subvar-x-cat-hs.json
index e9f7c4d38..d75531538 100644
--- a/tests/fixtures/ca-subvar-x-cat-hs.json
+++ b/tests/fixtures/ca-subvar-x-cat-hs.json
@@ -1,268 +1,256 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/c5288f7a139d486ba0845e42fe666525/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fc5288f7a139d486ba0845e42fe666525%2Fvariables%2F00000c%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fc5288f7a139d486ba0845e42fe666525%2Fvariables%2F00000c%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
- }
+ "query": {
+ "dimensions": [
+ {
+ "each": "https://alpha.crunch.io/api/datasets/c5288f7a139d486ba0845e42fe666525/variables/00000c/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/c5288f7a139d486ba0845e42fe666525/variables/00000c/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": null
+ },
+ "query_environment": {
+ "filter": []
+ },
+ "result": {
+ "counts": [
+ 3,
+ 3,
+ 0,
+ 0,
+ 0,
+ 1,
+ 3,
+ 2,
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ 3,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "categorical_array",
+ "description": null,
+ "is_dichotomous": false,
+ "name": "categorical_array",
+ "subreferences": [
+ {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
},
- "dimensions": [
- {
- "each": "https://alpha.crunch.io/api/datasets/c5288f7a139d486ba0845e42fe666525/variables/00000c/"
- },
+ {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
+ },
+ {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": [
{
- "variable": "https://alpha.crunch.io/api/datasets/c5288f7a139d486ba0845e42fe666525/variables/00000c/"
+ "anchor": "bottom",
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "AB NET"
}
- ],
- "weight": null
+ ]
+ }
+ }
},
- "query_environment": {
- "filter": [
-
- ]
- },
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "description": null,
- "subreferences": [
- {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- }
- ],
- "name": "categorical_array",
- "alias": "categorical_array",
- "is_dichotomous": false,
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "AB NET",
- "anchor": "bottom"
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- "id": "0007"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- "id": "0008"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- },
- "id": "0009"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": false,
- "references": {
- "description": null,
- "subreferences": [
- {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- }
- ],
- "name": "categorical_array",
- "alias": "categorical_array",
- "is_dichotomous": false,
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "AB NET",
- "anchor": "bottom"
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0007",
- "0008",
- "0009"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "missing": false,
- "id": 1,
- "name": "a"
- },
- {
- "numeric_value": null,
- "missing": false,
- "id": 2,
- "name": "b"
- },
- {
- "numeric_value": null,
- "missing": false,
- "id": 3,
- "name": "c"
- },
- {
- "numeric_value": null,
- "missing": false,
- "id": 4,
- "name": "d"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0007",
+ "references": {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0008",
+ "references": {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
+ }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0009",
+ "references": {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
}
- ],
- "missing": 0,
- "measures": {
- "count": {
- "data": [
- 3,
- 3,
- 0,
- 0,
- 0,
- 1,
- 3,
- 2,
- 0,
- 0,
- 0,
- 2,
- 1,
- 3,
- 0
- ],
- "n_missing": 0,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "categorical_array",
+ "description": null,
+ "is_dichotomous": false,
+ "name": "categorical_array",
+ "subreferences": [
+ {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
+ },
+ {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
+ },
+ {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": "bottom",
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "AB NET"
}
+ ]
+ }
+ }
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "a",
+ "numeric_value": null
},
- "element": "crunch:cube",
- "counts": [
- 3,
- 3,
- 0,
- 0,
- 0,
- 1,
- 3,
- 2,
- 0,
- 0,
- 0,
- 2,
- 1,
- 3,
- 0
- ],
- "n": 6
+ {
+ "id": 2,
+ "missing": false,
+ "name": "b",
+ "numeric_value": null
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "c",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "d",
+ "numeric_value": null
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0007",
+ "0008",
+ "0009"
+ ]
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 3,
+ 3,
+ 0,
+ 0,
+ 0,
+ 1,
+ 3,
+ 2,
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ 3,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 0
+ }
+ },
+ "missing": 0,
+ "n": 6
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/ca-x-cat-hs.json b/tests/fixtures/ca-x-cat-hs.json
index a754e37a9..72ada820f 100644
--- a/tests/fixtures/ca-x-cat-hs.json
+++ b/tests/fixtures/ca-x-cat-hs.json
@@ -1,520 +1,500 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fee87b889a43c4465bb8f5bcb239a723a%2Fvariables%2F00000c%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fee87b889a43c4465bb8f5bcb239a723a%2Fvariables%2F00000c%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fee87b889a43c4465bb8f5bcb239a723a%2Fvariables%2F000000%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
+ "query": {
+ "dimensions": [
+ {
+ "each": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/00000c/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/00000c/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/000000/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ }
+ },
+ "result": {
+ "counts": [
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "categorical_array",
+ "description": null,
+ "is_dichotomous": false,
+ "name": "categorical_array",
+ "subreferences": [
+ {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
+ },
+ {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
+ },
+ {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": []
+ }
+ }
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0007",
+ "references": {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
}
+ }
},
- "dimensions": [
- {
- "each": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/00000c/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/00000c/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/ee87b889a43c4465bb8f5bcb239a723a/variables/000000/"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0008",
+ "references": {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
}
- ],
- "weight": null
- },
- "query_environment": {
- "filter": [
-
- ]
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0009",
+ "references": {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
+ }
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "categorical_array",
+ "description": null,
+ "is_dichotomous": false,
+ "name": "categorical_array",
+ "subreferences": [
+ {
+ "alias": "ca_subvar_1",
+ "description": null,
+ "name": "ca_subvar_1"
+ },
+ {
+ "alias": "ca_subvar_2",
+ "description": null,
+ "name": "ca_subvar_2"
+ },
+ {
+ "alias": "ca_subvar_3",
+ "description": null,
+ "name": "ca_subvar_3"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": []
+ }
+ }
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "description": null,
- "subreferences": [
- {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- }
- ],
- "name": "categorical_array",
- "alias": "categorical_array",
- "is_dichotomous": false,
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
-
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- "id": "0007"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- "id": "0008"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- },
- "id": "0009"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "a",
+ "numeric_value": null
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "b",
+ "numeric_value": null
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "c",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "d",
+ "numeric_value": null
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0007",
+ "0008",
+ "0009"
+ ]
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "x",
+ "description": "Numeric variable with value labels",
+ "name": "x",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
{
- "references": {
- "description": null,
- "subreferences": [
- {
- "alias": "ca_subvar_1",
- "name": "ca_subvar_1",
- "description": null
- },
- {
- "alias": "ca_subvar_2",
- "name": "ca_subvar_2",
- "description": null
- },
- {
- "alias": "ca_subvar_3",
- "name": "ca_subvar_3",
- "description": null
- }
- ],
- "name": "categorical_array",
- "alias": "categorical_array",
- "is_dichotomous": false,
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
-
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "subvariables": [
- "0007",
- "0008",
- "0009"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "id": 1,
- "name": "a",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 2,
- "name": "b",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 3,
- "name": "c",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 4,
- "name": "d",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
+ "anchor": 3,
+ "args": [
+ 3,
+ 2,
+ 1
+ ],
+ "function": "subtotal",
+ "name": "colors"
},
{
- "references": {
- "alias": "x",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 3,
- 2,
- 1
- ],
- "name": "colors",
- "anchor": 3
- },
- {
- "function": "subtotal",
- "args": [
- 9,
- 4
- ],
- "name": "numbers",
- "anchor": 9
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- },
- "description": "Numeric variable with value labels",
- "name": "x"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "id": 1,
- "name": "red",
- "missing": false
- },
- {
- "numeric_value": 2,
- "id": 2,
- "name": "green",
- "missing": false
- },
- {
- "numeric_value": 3,
- "id": 3,
- "name": "blue",
- "missing": false
- },
- {
- "numeric_value": 4,
- "id": 4,
- "name": "4",
- "missing": false
- },
- {
- "numeric_value": 8,
- "id": 8,
- "name": "8",
- "missing": true
- },
- {
- "numeric_value": 9,
- "id": 9,
- "name": "9",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- }
- ],
- "missing": 1,
- "measures": {
- "count": {
- "data": [
- 1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 1,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ "anchor": 9,
+ "args": [
+ 9,
+ 4
+ ],
+ "function": "subtotal",
+ "name": "numbers"
}
+ ]
+ }
+ }
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "red",
+ "numeric_value": 1
},
- "element": "crunch:cube",
- "counts": [
- 1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n": 6
+ {
+ "id": 2,
+ "missing": false,
+ "name": "green",
+ "numeric_value": 2
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "blue",
+ "numeric_value": 3
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "4",
+ "numeric_value": 4
+ },
+ {
+ "id": 8,
+ "missing": true,
+ "name": "8",
+ "numeric_value": 8
+ },
+ {
+ "id": 9,
+ "missing": false,
+ "name": "9",
+ "numeric_value": 9
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 1
+ }
+ },
+ "missing": 1,
+ "n": 6
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/ca-x-mr-hs.json b/tests/fixtures/ca-x-mr-hs.json
index 70d28e4da..1ed50a1d1 100644
--- a/tests/fixtures/ca-x-mr-hs.json
+++ b/tests/fixtures/ca-x-mr-hs.json
@@ -1,1018 +1,1003 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d8%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d8%2F%22%7D,%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dd%2F%22%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dd%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d0%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
- }
+ "query": {
+ "dimensions": [
+ {
+ "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
+ },
+ {
+ "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/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 0,
+ 23,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 143,
+ 128,
+ 1391,
+ 141,
+ 126,
+ 1395,
+ 1389,
+ 33,
+ 240,
+ 0,
+ 0,
+ 1662
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "abolitionists",
+ "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
+ "name": "Abolitionists",
+ "notes": "A categorical array variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ },
+ {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
},
- "dimensions": [
+ {
+ "alias": "truth",
+ "name": "Sojourner Truth"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": [
{
- "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
+ "anchor": 2,
+ "args": [
+ 0,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "favorable"
},
{
- "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
- },
+ "anchor": 4,
+ "args": [
+ 3,
+ 4
+ ],
+ "function": "subtotal",
+ "name": "unfavorable"
+ }
+ ]
+ }
+ }
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0061",
+ "references": {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0062",
+ "references": {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
+ }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "fb4492a07d5142f9a9a49de9c07ce8a1",
+ "references": {
+ "alias": "truth",
+ "name": "Sojourner Truth"
+ }
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "abolitionists",
+ "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
+ "name": "Abolitionists",
+ "notes": "A categorical array variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ },
+ {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
+ },
+ {
+ "alias": "truth",
+ "name": "Sojourner Truth"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "transform": {
+ "insertions": [
{
- "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
+ "anchor": 2,
+ "args": [
+ 0,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "favorable"
},
{
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
- }
- ]
+ "anchor": 4,
+ "args": [
+ 3,
+ 4
+ ],
+ "function": "subtotal",
+ "name": "unfavorable"
}
- ],
- "weight": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ ]
+ }
+ }
},
- "query_environment": {
- "filter": [
-
- ]
+ "type": {
+ "categories": [
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Very favorable",
+ "numeric_value": 0,
+ "selected": false
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Somewhat favorable",
+ "numeric_value": 2,
+ "selected": false
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "Somewhat unfavorable",
+ "numeric_value": 3,
+ "selected": false
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Very unfavorable",
+ "numeric_value": 4,
+ "selected": false
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Don't know",
+ "numeric_value": 5,
+ "selected": false
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": 32766,
+ "selected": false
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": 32767,
+ "selected": false
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null,
+ "selected": false
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0061",
+ "0062",
+ "fb4492a07d5142f9a9a49de9c07ce8a1"
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "1984_countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "Countries from 1984",
+ "notes": "A multiple response variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ },
+ {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
+ },
+ {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
+ },
+ {
+ "alias": "disputed",
+ "name": "Disputed"
+ }
+ ],
+ "uniform_basis": false
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
- "subreferences": [
- {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- {
- "alias": "truth",
- "name": "Sojourner Truth"
- }
- ],
- "notes": "A categorical array variable, where one item has no responses",
- "name": "Abolitionists",
- "alias": "abolitionists",
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 0,
- 2
- ],
- "name": "favorable",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 4
- ],
- "name": "unfavorable",
- "anchor": 4
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- "id": "0061"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- "id": "0062"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "truth",
- "name": "Sojourner Truth"
- },
- "id": "fb4492a07d5142f9a9a49de9c07ce8a1"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": false,
- "references": {
- "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
- "subreferences": [
- {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- {
- "alias": "truth",
- "name": "Sojourner Truth"
- }
- ],
- "notes": "A categorical array variable, where one item has no responses",
- "name": "Abolitionists",
- "alias": "abolitionists",
- "view": {
- "show_counts": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 0,
- 2
- ],
- "name": "favorable",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 4
- ],
- "name": "unfavorable",
- "anchor": 4
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0061",
- "0062",
- "fb4492a07d5142f9a9a49de9c07ce8a1"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 0,
- "selected": false,
- "id": 0,
- "name": "Very favorable",
- "missing": false
- },
- {
- "numeric_value": 2,
- "selected": false,
- "id": 2,
- "name": "Somewhat favorable",
- "missing": false
- },
- {
- "numeric_value": 3,
- "selected": false,
- "id": 3,
- "name": "Somewhat unfavorable",
- "missing": false
- },
- {
- "numeric_value": 4,
- "selected": false,
- "id": 4,
- "name": "Very unfavorable",
- "missing": false
- },
- {
- "numeric_value": 5,
- "selected": false,
- "id": 5,
- "name": "Don't know",
- "missing": false
- },
- {
- "numeric_value": 32766,
- "selected": false,
- "id": 32766,
- "name": "skipped",
- "missing": true
- },
- {
- "numeric_value": 32767,
- "selected": false,
- "id": 32767,
- "name": "not asked",
- "missing": true
- },
- {
- "numeric_value": null,
- "selected": false,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- {
- "alias": "disputed",
- "name": "Disputed"
- }
- ],
- "notes": "A multiple response variable, where one item has no responses",
- "alias": "1984_countries",
- "name": "Countries from 1984"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- "id": "00c5"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- "id": "00c6"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- "id": "00c7"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "disputed",
- "name": "Disputed"
- },
- "id": "11b45a85e5ac4011bd3cf884b8a2476f"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "references": {
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- {
- "alias": "disputed",
- "name": "Disputed"
- }
- ],
- "notes": "A multiple response variable, where one item has no responses",
- "alias": "1984_countries",
- "name": "Countries from 1984"
- },
- "derived": true,
- "type": {
- "ordinal": false,
- "subvariables": [
- "00c5",
- "00c6",
- "00c7",
- "11b45a85e5ac4011bd3cf884b8a2476f"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Not Selected"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c5",
+ "references": {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c6",
+ "references": {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
}
- ],
- "missing": 10,
- "measures": {
- "count": {
- "data": [
- 22.2609925032701,
- 16.9844835303167,
- 222.310511064138,
- 21.4670764652966,
- 18.7623471388787,
- 221.32656349355,
- 219.182324478491,
- 3.19926616430062,
- 39.1743964549334,
- 0,
- 0,
- 261.555987097725,
- 34.4602057043984,
- 38.9081180709724,
- 318.459577115524,
- 44.0133766327096,
- 40.2937863255125,
- 307.520737932672,
- 314.365248914328,
- 11.0374449013001,
- 66.4252070752666,
- 0,
- 0,
- 391.827900890895,
- 25.5630888770301,
- 35.7209072453127,
- 202.837216191128,
- 25.335068002585,
- 30.4374108415629,
- 208.348733469323,
- 217.584012509558,
- 8.94596533741205,
- 37.5912344665001,
- 0,
- 0,
- 264.121212313471,
- 32.4017181382625,
- 31.0352661360065,
- 438.013129815619,
- 33.841067995359,
- 33.331393844497,
- 434.277652250033,
- 438.909164860856,
- 5.0196677412525,
- 57.5212814877798,
- 0,
- 0,
- 501.450114089889,
- 4.99112939798944,
- 28.002444742699,
- 179.351243978733,
- 8.54509709144171,
- 26.3461434771868,
- 177.453577550793,
- 198.80859162999,
- 1.65630126551221,
- 11.8799252239189,
- 0,
- 0,
- 212.344818119421,
- 0.752560977946403,
- 6.91918433229187,
- 23.0282221783644,
- 3.60847290734546,
- 5.74004220502229,
- 21.351452376235,
- 23.6917151822036,
- 3.82636054837688,
- 3.18189175802228,
- 0,
- 0,
- 30.6999674886027,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 15.1064515178025,
- 14.8964289544671,
- 140.995495924001,
- 21.0230096950105,
- 12.9669188119134,
- 137.008447889347,
- 135.917515423371,
- 3.7245122738576,
- 31.3563486990416,
- 0,
- 0,
- 170.998376396271,
- 32.5604100093203,
- 41.4234601652912,
- 329.92570090253,
- 34.3230034411795,
- 41.2112974042019,
- 328.37527023176,
- 338.33312724915,
- 9.33037214070239,
- 56.2460716872887,
- 0,
- 0,
- 403.909571077141,
- 25.1241675577809,
- 28.2218351521075,
- 215.050092465812,
- 29.5531524247545,
- 26.870502142431,
- 211.972440608514,
- 217.765472615634,
- 8.59861013012241,
- 42.0320124299436,
- 0,
- 0,
- 268.3960951757,
- 41.5686964119083,
- 41.9334112591193,
- 486.723309333154,
- 40.0469902636259,
- 43.5846394210477,
- 486.593787319508,
- 492.635593733922,
- 6.88919293488811,
- 70.7006303353718,
- 0,
- 0,
- 570.225417004182,
- 5.23117131012065,
- 28.002444742699,
- 187.651851514459,
- 8.22537078190222,
- 26.3461434771868,
- 186.31395330819,
- 207.428925475256,
- 1.65630126551221,
- 11.8002408265107,
- 0,
- 0,
- 220.885467567279,
- 0.838798791964368,
- 3.09282378391499,
- 23.6534502035512,
- 3.63863248826485,
- 3.93162257587936,
- 20.0148177152864,
- 20.460423078094,
- 3.48601721307167,
- 3.63863248826485,
- 0,
- 0,
- 27.5850727794306,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 120.429695598897,
- 157.570404057599,
- 1383.9999003435,
- 136.810159094737,
- 154.91112383266,
- 1370.2787170726,
- 1412.54105757542,
- 33.6850059581544,
- 215.773936466421,
- 0,
- 0,
- 1661.99999999999
- ],
- "n_missing": 10,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c7",
+ "references": {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
}
+ }
},
- "element": "crunch:cube",
- "counts": [
- 34,
- 21,
- 257,
- 29,
- 23,
- 260,
- 251,
- 6,
- 55,
- 0,
- 0,
- 312,
- 39,
- 36,
- 340,
- 43,
- 35,
- 337,
- 335,
- 11,
- 69,
- 0,
- 0,
- 415,
- 26,
- 23,
- 222,
- 26,
- 20,
- 225,
- 223,
- 7,
- 41,
- 0,
- 0,
- 271,
- 37,
- 26,
- 427,
- 33,
- 28,
- 429,
- 424,
- 6,
- 60,
- 0,
- 0,
- 490,
- 6,
- 18,
- 129,
- 7,
- 17,
- 129,
- 140,
- 1,
- 12,
- 0,
- 0,
- 153,
- 1,
- 4,
- 16,
- 3,
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
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 143,
- 128,
- 1391,
- 141,
- 126,
- 1395,
- 1389,
- 33,
- 240,
- 0,
- 0,
- 1662
- ],
- "n": 1662
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "11b45a85e5ac4011bd3cf884b8a2476f",
+ "references": {
+ "alias": "disputed",
+ "name": "Disputed"
+ }
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
}
- }
-}
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "1984_countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "Countries from 1984",
+ "notes": "A multiple response variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ },
+ {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
+ },
+ {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
+ },
+ {
+ "alias": "disputed",
+ "name": "Disputed"
+ }
+ ],
+ "uniform_basis": false
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Not Selected",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00c5",
+ "00c6",
+ "00c7",
+ "11b45a85e5ac4011bd3cf884b8a2476f"
+ ]
+ }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 22.2609925032701,
+ 16.9844835303167,
+ 222.310511064138,
+ 21.4670764652966,
+ 18.7623471388787,
+ 221.32656349355,
+ 219.182324478491,
+ 3.19926616430062,
+ 39.1743964549334,
+ 0,
+ 0,
+ 261.555987097725,
+ 34.4602057043984,
+ 38.9081180709724,
+ 318.459577115524,
+ 44.0133766327096,
+ 40.2937863255125,
+ 307.520737932672,
+ 314.365248914328,
+ 11.0374449013001,
+ 66.4252070752666,
+ 0,
+ 0,
+ 391.827900890895,
+ 25.5630888770301,
+ 35.7209072453127,
+ 202.837216191128,
+ 25.335068002585,
+ 30.4374108415629,
+ 208.348733469323,
+ 217.584012509558,
+ 8.94596533741205,
+ 37.5912344665001,
+ 0,
+ 0,
+ 264.121212313471,
+ 32.4017181382625,
+ 31.0352661360065,
+ 438.013129815619,
+ 33.841067995359,
+ 33.331393844497,
+ 434.277652250033,
+ 438.909164860856,
+ 5.0196677412525,
+ 57.5212814877798,
+ 0,
+ 0,
+ 501.450114089889,
+ 4.99112939798944,
+ 28.002444742699,
+ 179.351243978733,
+ 8.54509709144171,
+ 26.3461434771868,
+ 177.453577550793,
+ 198.80859162999,
+ 1.65630126551221,
+ 11.8799252239189,
+ 0,
+ 0,
+ 212.344818119421,
+ 0.752560977946403,
+ 6.91918433229187,
+ 23.0282221783644,
+ 3.60847290734546,
+ 5.74004220502229,
+ 21.351452376235,
+ 23.6917151822036,
+ 3.82636054837688,
+ 3.18189175802228,
+ 0,
+ 0,
+ 30.6999674886027,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 15.1064515178025,
+ 14.8964289544671,
+ 140.995495924001,
+ 21.0230096950105,
+ 12.9669188119134,
+ 137.008447889347,
+ 135.917515423371,
+ 3.7245122738576,
+ 31.3563486990416,
+ 0,
+ 0,
+ 170.998376396271,
+ 32.5604100093203,
+ 41.4234601652912,
+ 329.92570090253,
+ 34.3230034411795,
+ 41.2112974042019,
+ 328.37527023176,
+ 338.33312724915,
+ 9.33037214070239,
+ 56.2460716872887,
+ 0,
+ 0,
+ 403.909571077141,
+ 25.1241675577809,
+ 28.2218351521075,
+ 215.050092465812,
+ 29.5531524247545,
+ 26.870502142431,
+ 211.972440608514,
+ 217.765472615634,
+ 8.59861013012241,
+ 42.0320124299436,
+ 0,
+ 0,
+ 268.3960951757,
+ 41.5686964119083,
+ 41.9334112591193,
+ 486.723309333154,
+ 40.0469902636259,
+ 43.5846394210477,
+ 486.593787319508,
+ 492.635593733922,
+ 6.88919293488811,
+ 70.7006303353718,
+ 0,
+ 0,
+ 570.225417004182,
+ 5.23117131012065,
+ 28.002444742699,
+ 187.651851514459,
+ 8.22537078190222,
+ 26.3461434771868,
+ 186.31395330819,
+ 207.428925475256,
+ 1.65630126551221,
+ 11.8002408265107,
+ 0,
+ 0,
+ 220.885467567279,
+ 0.838798791964368,
+ 3.09282378391499,
+ 23.6534502035512,
+ 3.63863248826485,
+ 3.93162257587936,
+ 20.0148177152864,
+ 20.460423078094,
+ 3.48601721307167,
+ 3.63863248826485,
+ 0,
+ 0,
+ 27.5850727794306,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 120.429695598897,
+ 157.570404057599,
+ 1383.9999003435,
+ 136.810159094737,
+ 154.91112383266,
+ 1370.2787170726,
+ 1412.54105757542,
+ 33.6850059581544,
+ 215.773936466421,
+ 0,
+ 0,
+ 1661.99999999999
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 10
+ }
+ },
+ "missing": 10,
+ "n": 1662
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/ca-x-mr-sig-testing-subtotals.json b/tests/fixtures/ca-x-mr-sig-testing-subtotals.json
index aced8f38f..d00761fb0 100644
--- a/tests/fixtures/ca-x-mr-sig-testing-subtotals.json
+++ b/tests/fixtures/ca-x-mr-sig-testing-subtotals.json
@@ -1,1319 +1,1309 @@
{
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
+ "meta": {
+ "display_settings": {
+ "countsOrPercents": {
+ "value": "percent"
+ },
+ "currentTab": {
+ "value": 0
+ },
+ "decimalPlaces": {
+ "value": 1
+ },
+ "percentageDirection": {
+ "value": "rowPct"
+ },
+ "populationMagnitude": {
+ "value": 3
+ },
+ "showEmpty": {
+ "value": false
+ },
+ "showNotes": {
+ "value": false
+ },
+ "showSignif": {
+ "value": true
+ },
+ "uiView": {
+ "value": "app.datasets.analyze"
+ },
+ "vizType": {
+ "value": "table"
+ }
+ },
+ "filters": [],
+ "name": "Bolshevik facial hair row %, sig testing",
+ "subtitle": "row %, sig testing",
+ "table_title": "",
+ "title": "Bolshevik facial hair",
+ "weight": "weight"
+ },
+ "value": {
+ "query": {
+ "dimensions": [
+ {
+ "each": 1
+ },
+ {
+ "variable": "0000d1"
+ },
+ {
+ "each": 3
+ },
+ {
+ "args": [
+ {
+ "variable": "0000dc"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "http://127.0.0.1:8080/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ },
+ "query_environment": {
+ "filter": []
+ },
+ "result": {
+ "counts": [
+ 2,
+ 0,
+ 11,
+ 2,
+ 1,
+ 10,
+ 2,
+ 1,
+ 10,
+ 6,
+ 1,
+ 6,
+ 3,
+ 1,
+ 9,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 11,
+ 103,
+ 727,
+ 66,
+ 98,
+ 677,
+ 87,
+ 91,
+ 663,
+ 327,
+ 55,
+ 459,
+ 411,
+ 62,
+ 368,
+ 14,
+ 21,
+ 77,
+ 12,
+ 25,
+ 75,
+ 8,
+ 25,
+ 79,
+ 26,
+ 23,
+ 63,
+ 63,
+ 12,
+ 37,
+ 6,
+ 55,
+ 365,
+ 38,
+ 49,
+ 339,
+ 72,
+ 47,
+ 307,
+ 198,
+ 24,
+ 204,
+ 168,
+ 41,
+ 217,
+ 0,
+ 43,
+ 227,
+ 25,
+ 38,
+ 207,
+ 31,
+ 38,
+ 201,
+ 80,
+ 31,
+ 159,
+ 150,
+ 22,
+ 98,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 8,
+ 20,
+ 94,
+ 13,
+ 20,
+ 89,
+ 13,
+ 18,
+ 91,
+ 37,
+ 17,
+ 68,
+ 61,
+ 11,
+ 50,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
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,
+ 16,
+ 91,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 3,
+ 5,
+ 28,
+ 4,
+ 5,
+ 27,
+ 4,
+ 5,
+ 27,
+ 12,
+ 5,
+ 19,
+ 15,
+ 4,
+ 17,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 7,
+ 6,
+ 37,
+ 6,
+ 10,
+ 34,
+ 7,
+ 8,
+ 35,
+ 12,
+ 9,
+ 29,
+ 27,
+ 4,
+ 19,
+ 13,
+ 117,
+ 743,
+ 64,
+ 110,
+ 699,
+ 75,
+ 107,
+ 691,
+ 334,
+ 65,
+ 474,
+ 442,
+ 68,
+ 363,
+ 10,
+ 61,
+ 381,
+ 43,
+ 54,
+ 355,
+ 84,
+ 52,
+ 316,
+ 198,
+ 32,
+ 222,
+ 177,
+ 49,
+ 226,
+ 0,
+ 33,
+ 218,
+ 26,
+ 32,
+ 193,
+ 30,
+ 30,
+ 191,
+ 81,
+ 23,
+ 147,
+ 134,
+ 13,
+ 104,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "bolshevik_hair",
+ "description": "In your opinion, each of these famous Bolshevik's facial hair is...",
+ "is_dichotomous": false,
+ "name": "Bolshevik facial hair",
+ "notes": "A categorical array variable where the missing categories are interspersed throughout the non-missing categories",
+ "subreferences": [
+ {
+ "alias": "stalin",
+ "description": "cabatt_1",
+ "name": "იოსებ სტალინი (Stalin)"
+ },
+ {
+ "alias": "trotsky",
+ "description": "cabatt_6",
+ "name": "Лев Троцкий (Trotsky)"
+ },
+ {
+ "alias": "kalinin",
+ "description": "cabatt_3",
+ "name": "Михаи́л Ива́нович Кали́нин (Kalinin)"
+ },
+ {
+ "alias": "lenin",
+ "description": "cabatt_7",
+ "name": "Владимир Ленин (Lenin)"
+ }
+ ]
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0007",
+ "references": {
+ "alias": "stalin",
+ "description": "cabatt_1",
+ "name": "იოსებ სტალინი (Stalin)"
+ }
}
- },
- "dimensions": [
- {
- "each": 1
- },
- {
- "variable": "0000d1"
- },
- {
- "each": 3
- },
- {
- "function": "as_selected",
- "args": [
- {
- "variable": "0000dc"
- }
- ]
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0008",
+ "references": {
+ "alias": "trotsky",
+ "description": "cabatt_6",
+ "name": "Лев Троцкий (Trotsky)"
+ }
}
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0009",
+ "references": {
+ "alias": "kalinin",
+ "description": "cabatt_3",
+ "name": "Михаи́л Ива́нович Кали́нин (Kalinin)"
+ }
+ }
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "000a",
+ "references": {
+ "alias": "lenin",
+ "description": "cabatt_7",
+ "name": "Владимир Ленин (Lenin)"
+ }
+ }
+ }
],
- "weight": "http://127.0.0.1:8080/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ "subtype": {
+ "class": "variable"
+ }
+ }
},
- "query_environment": {
- "filter": [
-
+ {
+ "derived": false,
+ "references": {
+ "alias": "bolshevik_hair",
+ "description": "In your opinion, each of these famous Bolshevik's facial hair is...",
+ "is_dichotomous": false,
+ "name": "Bolshevik facial hair",
+ "notes": "A categorical array variable where the missing categories are interspersed throughout the non-missing categories",
+ "subreferences": [
+ {
+ "alias": "stalin",
+ "description": "cabatt_1",
+ "name": "იოსებ სტალინი (Stalin)"
+ },
+ {
+ "alias": "trotsky",
+ "description": "cabatt_6",
+ "name": "Лев Троцкий (Trotsky)"
+ },
+ {
+ "alias": "kalinin",
+ "description": "cabatt_3",
+ "name": "Михаи́л Ива́нович Кали́нин (Kalinin)"
+ },
+ {
+ "alias": "lenin",
+ "description": "cabatt_7",
+ "name": "Владимир Ленин (Lenin)"
+ }
]
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": 32766,
+ "selected": false
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": 32767,
+ "selected": false
+ },
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Too much",
+ "numeric_value": 1,
+ "selected": false
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Too little",
+ "numeric_value": 5,
+ "selected": false
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "The right amount",
+ "numeric_value": 0,
+ "selected": false
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Not sure",
+ "numeric_value": 4,
+ "selected": false
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null,
+ "selected": false
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0007",
+ "0008",
+ "0009",
+ "000a"
+ ]
+ }
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "description": "In your opinion, each of these famous Bolshevik's facial hair is...",
- "subreferences": [
- {
- "alias": "stalin",
- "name": "იოსებ სტალინი (Stalin)",
- "description": "cabatt_1"
- },
- {
- "alias": "trotsky",
- "name": "Лев Троцкий (Trotsky)",
- "description": "cabatt_6"
- },
- {
- "alias": "kalinin",
- "name": "Михаи́л Ива́нович Кали́нин (Kalinin)",
- "description": "cabatt_3"
- },
- {
- "alias": "lenin",
- "name": "Владимир Ленин (Lenin)",
- "description": "cabatt_7"
- }
- ],
- "notes": "A categorical array variable where the missing categories are interspersed throughout the non-missing categories",
- "alias": "bolshevik_hair",
- "is_dichotomous": false,
- "name": "Bolshevik facial hair"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "stalin",
- "name": "იოსებ სტალინი (Stalin)",
- "description": "cabatt_1"
- },
- "id": "0007"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "trotsky",
- "name": "Лев Троцкий (Trotsky)",
- "description": "cabatt_6"
- },
- "id": "0008"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "kalinin",
- "name": "Михаи́л Ива́нович Кали́нин (Kalinin)",
- "description": "cabatt_3"
- },
- "id": "0009"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "lenin",
- "name": "Владимир Ленин (Lenin)",
- "description": "cabatt_7"
- },
- "id": "000a"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "references": {
- "description": "In your opinion, each of these famous Bolshevik's facial hair is...",
- "subreferences": [
- {
- "alias": "stalin",
- "name": "იოსებ სტალინი (Stalin)",
- "description": "cabatt_1"
- },
- {
- "alias": "trotsky",
- "name": "Лев Троцкий (Trotsky)",
- "description": "cabatt_6"
- },
- {
- "alias": "kalinin",
- "name": "Михаи́л Ива́нович Кали́нин (Kalinin)",
- "description": "cabatt_3"
- },
- {
- "alias": "lenin",
- "name": "Владимир Ленин (Lenin)",
- "description": "cabatt_7"
- }
- ],
- "notes": "A categorical array variable where the missing categories are interspersed throughout the non-missing categories",
- "alias": "bolshevik_hair",
- "is_dichotomous": false,
- "name": "Bolshevik facial hair"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "subvariables": [
- "0007",
- "0008",
- "0009",
- "000a"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 32766,
- "selected": false,
- "id": 32766,
- "missing": true,
- "name": "skipped"
- },
- {
- "numeric_value": 32767,
- "selected": false,
- "id": 32767,
- "missing": true,
- "name": "not asked"
- },
- {
- "numeric_value": 1,
- "selected": false,
- "id": 1,
- "missing": false,
- "name": "Too much"
- },
- {
- "numeric_value": 5,
- "selected": false,
- "id": 5,
- "missing": false,
- "name": "Too little"
- },
- {
- "numeric_value": 0,
- "selected": false,
- "id": 0,
- "missing": false,
- "name": "The right amount"
- },
- {
- "numeric_value": 4,
- "selected": false,
- "id": 4,
- "missing": false,
- "name": "Not sure"
- },
- {
- "numeric_value": null,
- "selected": false,
- "id": -1,
- "missing": true,
- "name": "No Data"
- }
- ]
- }
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": "Which of the following Nordic countries have you visited? (select all that apply)",
- "subreferences": [
- {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- }
- ],
- "notes": "A multiple response variable",
- "alias": "nordics",
- "is_dichotomous": true,
- "name": "Nordic countries"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- "id": "00c0"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- "id": "00c1"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- "id": "00c2"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- "id": "00c3"
- },
- "missing": false
- },
- {
- "id": 5,
- "value": {
- "derived": false,
- "references": {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- },
- "id": "00c4"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "references": {
- "uniform_basis": false,
- "description": "Which of the following Nordic countries have you visited? (select all that apply)",
- "subreferences": [
- {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- }
- ],
- "notes": "A multiple response variable",
- "alias": "nordics",
- "is_dichotomous": true,
- "name": "Nordic countries"
- },
- "derived": true,
- "type": {
- "ordinal": false,
- "subvariables": [
- "00c0",
- "00c1",
- "00c2",
- "00c3",
- "00c4"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
+ {
+ "derived": true,
+ "references": {
+ "alias": "nordics",
+ "description": "Which of the following Nordic countries have you visited? (select all that apply)",
+ "is_dichotomous": true,
+ "name": "Nordic countries",
+ "notes": "A multiple response variable",
+ "subreferences": [
+ {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ },
+ {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
+ },
+ {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ },
+ {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
+ },
+ {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
],
- "missing": 2,
- "measures": {
- "count": {
- "data": [
- 1.65979771819165,
- 0,
- 13.9270274647004,
- 2.96344574716368,
- 0.869333895168885,
- 11.7540455405595,
- 3.55285297013774,
- 0.869333895168885,
- 11.1646383175855,
- 6.52277188778838,
- 0.869333895168885,
- 8.19471939993482,
- 4.36193975760226,
- 0.869333895168885,
- 10.3555515301209,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 13.4450929625256,
- 98.5136182913165,
- 637.357265730664,
- 61.2754570548901,
- 90.3575943414785,
- 597.682925588138,
- 81.7170906635991,
- 82.0862071309613,
- 585.512679189947,
- 289.002137768091,
- 55.1505605139189,
- 405.163278702498,
- 365.242891723743,
- 60.982614017616,
- 323.090471243148,
- 17.0666209331443,
- 21.0952779612099,
- 85.3109693192459,
- 7.59343081445309,
- 28.8228628784548,
- 87.0565745206922,
- 9.53802171286541,
- 26.9336335934349,
- 87.0012129072998,
- 26.8695623224513,
- 25.1096490359858,
- 71.4936568551631,
- 71.1192039225491,
- 14.5780813304951,
- 37.775582960556,
- 8.43877713273272,
- 53.1035917252477,
- 375.381200046677,
- 40.7358749480332,
- 46.7999714087435,
- 349.387722547881,
- 77.1299416653173,
- 43.3108120359689,
- 316.482815203371,
- 201.418329955483,
- 22.5362168813994,
- 212.969022067774,
- 170.468212429121,
- 39.0055389037504,
- 227.449817571786,
- 0,
- 57.3600521744947,
- 279.340708539851,
- 29.4866043931536,
- 51.9314858612711,
- 255.28267045992,
- 38.8808865828423,
- 50.3200348073874,
- 247.499839324115,
- 96.5965694508612,
- 41.195851006618,
- 198.908340256866,
- 191.981840681226,
- 30.8315816067175,
- 113.887338426401,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 9.92029297553869,
- 19.7400483331064,
- 100.386558093686,
- 15.4068400875812,
- 18.3569639068771,
- 96.2830954078732,
- 16.962754226054,
- 18.0623538012876,
- 95.0217913749899,
- 38.2076107233431,
- 16.4928838085727,
- 75.3464048704157,
- 62.3208239731381,
- 11.2735952280151,
- 56.4524802011783,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 9.87508327949836,
- 14.3192353964892,
- 59.1464514515102,
- 11.2675056435235,
- 14.8125191759469,
- 57.2607453080274,
- 4.14769665520673,
- 15.8715784694538,
- 63.3214950028372,
- 29.5291244255024,
- 11.3995424297982,
- 42.4121032721972,
- 40.1703043219586,
- 6.0243791126203,
- 37.1460866929189,
- 8.26652216766441,
- 92.1124289304242,
- 583.886280923837,
- 44.7633542317244,
- 89.2159585232686,
- 550.285919266933,
- 72.9724640027403,
- 80.8641530548241,
- 530.428614964361,
- 262.725838840513,
- 50.8439220326181,
- 370.695471148794,
- 344.509723255133,
- 53.429683427805,
- 286.325825338988,
- 11.6790564287239,
- 65.9042793868665,
- 430.612851224218,
- 48.452820418072,
- 61.5098859751909,
- 398.233480646545,
- 97.9831080092136,
- 51.6630334093814,
- 358.550045621213,
- 230.195652788106,
- 35.9405577337742,
- 242.059976517927,
- 189.120896455771,
- 61.0321581081886,
- 258.043132475847,
- 0.869333895168885,
- 37.9965481053825,
- 217.285029407888,
- 22.1642925767926,
- 34.8859208038335,
- 199.100698027813,
- 18.7527707015473,
- 37.0589027279744,
- 200.339237978918,
- 59.7511446072099,
- 30.1847053283278,
- 166.215061472902,
- 167.052340508241,
- 14.507333877119,
- 74.5912370230791,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 2.42933078007588,
- 5.73235617508201,
- 15.6761902934751,
- 1.49850936604462,
- 5.73235617508201,
- 16.6070117075063,
- 1.17914212726958,
- 4.55321404781243,
- 18.105521073551,
- 6.30300052058957,
- 3.66832493590669,
- 13.8665517921367,
- 12.4278944546533,
- 3.2431733664449,
- 8.16680942753475,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 8.39573480666894,
- 15.4952298170233,
- 52.2126508237706,
- 9.63714424049469,
- 13.5299057251883,
- 52.9365654817798,
- 9.44718715255943,
- 16.423348084818,
- 50.2330802100854,
- 20.2725788355165,
- 15.5173619618845,
- 40.3136746500617,
- 38.2927497189588,
- 11.7829715350995,
- 26.0278941934044,
- 19.8790071809217,
- 101.463116569833,
- 690.602976143096,
- 56.2163206284992,
- 101.079268064969,
- 654.649511200382,
- 83.0535948165,
- 92.0948878952942,
- 636.796617182056,
- 305.193372894763,
- 61.7735922552134,
- 444.978134743874,
- 409.640858024675,
- 58.4146893501378,
- 343.889552519038,
- 9.90621597892775,
- 55.0278610296194,
- 373.394659352381,
- 47.5206499389839,
- 49.7954153803178,
- 341.012671041626,
- 87.6132785569048,
- 44.5474174001837,
- 306.168040403839,
- 195.2019421789,
- 28.533287182771,
- 214.593506999257,
- 161.147898277143,
- 46.105052664534,
- 231.075785419251,
- 0,
- 52.3539765607115,
- 259.430694488416,
- 27.1821887836713,
- 48.6443030395595,
- 235.958179225897,
- 29.5255909415281,
- 45.9011540348131,
- 236.357926072787,
- 93.4384769549071,
- 35.3690449973153,
- 182.977149096906,
- 181.664688038812,
- 26.7212628375317,
- 103.398720172784,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 2.48602468962541,
- 4.19192804715235,
- 29.2975988261611,
- 3.35752276599355,
- 4.40276191314031,
- 28.215266883805,
- 2.48488123654107,
- 4.74684536925195,
- 28.7438249571458,
- 9.79314957086999,
- 4.39606372450688,
- 21.786338267562,
- 19.7467025646989,
- 2.88369251029536,
- 13.3451564879445,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 9.7803012222566,
- 6.15339934156018,
- 44.0999854612128,
- 3.90892821413032,
- 9.76028796541731,
- 46.364469845482,
- 10.0914706410191,
- 7.70574241452484,
- 42.2364729694857,
- 15.859766758229,
- 9.20425178056946,
- 34.9696674862312,
- 29.7415054659447,
- 3.60688862385713,
- 26.6852919352278,
- 16.4479903421807,
- 104.780079711006,
- 665.300707451108,
- 56.4011671534055,
- 98.8446927148957,
- 631.282917635994,
- 69.5019838118314,
- 90.4826917485473,
- 626.544101943917,
- 302.819307729484,
- 57.2636975473541,
- 426.445772227457,
- 393.969196389827,
- 65.6359015405782,
- 326.923679573891,
- 11.8959724925315,
- 68.1512334899437,
- 387.58261153286,
- 46.4212628337103,
- 59.4260278916545,
- 361.78252678997,
- 94.5383231761747,
- 56.9508276865298,
- 316.14066665263,
- 199.684866385115,
- 39.1206672034273,
- 228.824283926792,
- 179.84721102297,
- 58.1884131325316,
- 229.594193359833,
- 0,
- 46.7958995626063,
- 265.036267829797,
- 31.965931990454,
- 46.3474779000091,
- 233.51875750194,
- 34.2021347291957,
- 43.6339142440675,
- 233.99611841914,
- 92.252280940977,
- 34.8769310772332,
- 184.702955374193,
- 179.869473070801,
- 15.9522539464857,
- 116.010440375116,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 2,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ "uniform_basis": false
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c0",
+ "references": {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c1",
+ "references": {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
+ }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c2",
+ "references": {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ }
+ }
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c3",
+ "references": {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
+ }
+ }
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c4",
+ "references": {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
}
- },
- "element": "crunch:cube",
- "counts": [
- 2,
- 0,
- 11,
- 2,
- 1,
- 10,
- 2,
- 1,
- 10,
- 6,
- 1,
- 6,
- 3,
- 1,
- 9,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 11,
- 103,
- 727,
- 66,
- 98,
- 677,
- 87,
- 91,
- 663,
- 327,
- 55,
- 459,
- 411,
- 62,
- 368,
- 14,
- 21,
- 77,
- 12,
- 25,
- 75,
- 8,
- 25,
- 79,
- 26,
- 23,
- 63,
- 63,
- 12,
- 37,
- 6,
- 55,
- 365,
- 38,
- 49,
- 339,
- 72,
- 47,
- 307,
- 198,
- 24,
- 204,
- 168,
- 41,
- 217,
- 0,
- 43,
- 227,
- 25,
- 38,
- 207,
- 31,
- 38,
- 201,
- 80,
- 31,
- 159,
- 150,
- 22,
- 98,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 8,
- 20,
- 94,
- 13,
- 20,
- 89,
- 13,
- 18,
- 91,
- 37,
- 17,
- 68,
- 61,
- 11,
- 50,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 8,
- 13,
- 47,
- 10,
- 14,
- 44,
- 3,
- 15,
- 50,
- 19,
- 10,
- 39,
- 36,
- 7,
- 25,
- 7,
- 103,
- 675,
- 50,
- 98,
- 637,
- 80,
- 94,
- 611,
- 301,
- 57,
- 427,
- 396,
- 59,
- 330,
- 9,
- 60,
- 418,
- 50,
- 55,
- 382,
- 88,
- 50,
- 349,
- 226,
- 31,
- 230,
- 180,
- 50,
- 257,
- 1,
- 26,
- 173,
- 20,
- 24,
- 156,
- 16,
- 25,
- 159,
- 54,
- 19,
- 127,
- 122,
- 11,
- 67,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 2,
- 6,
- 11,
- 1,
- 6,
- 12,
- 1,
- 5,
- 13,
- 5,
- 4,
- 10,
- 10,
- 3,
- 6,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 10,
- 13,
- 44,
- 9,
- 15,
- 43,
- 10,
- 14,
- 43,
- 18,
- 12,
- 37,
- 32,
- 11,
- 24,
- 15,
- 113,
- 766,
- 61,
- 110,
- 723,
- 87,
- 106,
- 701,
- 337,
- 68,
- 489,
- 450,
- 64,
- 380,
- 6,
- 57,
- 374,
- 51,
- 49,
- 337,
- 79,
- 48,
- 310,
- 198,
- 28,
- 211,
- 165,
- 44,
- 228,
- 0,
- 33,
- 212,
- 21,
- 31,
- 193,
- 23,
- 29,
- 193,
- 79,
- 22,
- 144,
- 138,
- 16,
- 91,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 3,
- 5,
- 28,
- 4,
- 5,
- 27,
- 4,
- 5,
- 27,
- 12,
- 5,
- 19,
- 15,
- 4,
- 17,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 7,
- 6,
- 37,
- 6,
- 10,
- 34,
- 7,
- 8,
- 35,
- 12,
- 9,
- 29,
- 27,
- 4,
- 19,
- 13,
- 117,
- 743,
- 64,
- 110,
- 699,
- 75,
- 107,
- 691,
- 334,
- 65,
- 474,
- 442,
- 68,
- 363,
- 10,
- 61,
- 381,
- 43,
- 54,
- 355,
- 84,
- 52,
- 316,
- 198,
- 32,
- 222,
- 177,
- 49,
- 226,
- 0,
- 33,
- 218,
- 26,
- 32,
- 193,
- 30,
- 30,
- 191,
- 81,
- 23,
- 147,
- 134,
- 13,
- 104,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
+ }
],
- "n": 1662
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "nordics",
+ "description": "Which of the following Nordic countries have you visited? (select all that apply)",
+ "is_dichotomous": true,
+ "name": "Nordic countries",
+ "notes": "A multiple response variable",
+ "subreferences": [
+ {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ },
+ {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
+ },
+ {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ },
+ {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
+ },
+ {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
+ ],
+ "uniform_basis": false
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00c0",
+ "00c1",
+ "00c2",
+ "00c3",
+ "00c4"
+ ]
+ }
}
- },
- "meta": {
- "subtitle": "row %, sig testing",
- "name": "Bolshevik facial hair row %, sig testing",
- "weight": "weight",
- "title": "Bolshevik facial hair",
- "filters": [
-
- ],
- "table_title": "",
- "display_settings": {
- "percentageDirection": {
- "value": "rowPct"
- },
- "showEmpty": {
- "value": false
- },
- "vizType": {
- "value": "table"
- },
- "countsOrPercents": {
- "value": "percent"
- },
- "decimalPlaces": {
- "value": 1
- },
- "populationMagnitude": {
- "value": 3
- },
- "showSignif": {
- "value": true
- },
- "currentTab": {
- "value": 0
- },
- "uiView": {
- "value": "app.datasets.analyze"
- },
- "showNotes": {
- "value": false
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 1.65979771819165,
+ 0,
+ 13.9270274647004,
+ 2.96344574716368,
+ 0.869333895168885,
+ 11.7540455405595,
+ 3.55285297013774,
+ 0.869333895168885,
+ 11.1646383175855,
+ 6.52277188778838,
+ 0.869333895168885,
+ 8.19471939993482,
+ 4.36193975760226,
+ 0.869333895168885,
+ 10.3555515301209,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 13.4450929625256,
+ 98.5136182913165,
+ 637.357265730664,
+ 61.2754570548901,
+ 90.3575943414785,
+ 597.682925588138,
+ 81.7170906635991,
+ 82.0862071309613,
+ 585.512679189947,
+ 289.002137768091,
+ 55.1505605139189,
+ 405.163278702498,
+ 365.242891723743,
+ 60.982614017616,
+ 323.090471243148,
+ 17.0666209331443,
+ 21.0952779612099,
+ 85.3109693192459,
+ 7.59343081445309,
+ 28.8228628784548,
+ 87.0565745206922,
+ 9.53802171286541,
+ 26.9336335934349,
+ 87.0012129072998,
+ 26.8695623224513,
+ 25.1096490359858,
+ 71.4936568551631,
+ 71.1192039225491,
+ 14.5780813304951,
+ 37.775582960556,
+ 8.43877713273272,
+ 53.1035917252477,
+ 375.381200046677,
+ 40.7358749480332,
+ 46.7999714087435,
+ 349.387722547881,
+ 77.1299416653173,
+ 43.3108120359689,
+ 316.482815203371,
+ 201.418329955483,
+ 22.5362168813994,
+ 212.969022067774,
+ 170.468212429121,
+ 39.0055389037504,
+ 227.449817571786,
+ 0,
+ 57.3600521744947,
+ 279.340708539851,
+ 29.4866043931536,
+ 51.9314858612711,
+ 255.28267045992,
+ 38.8808865828423,
+ 50.3200348073874,
+ 247.499839324115,
+ 96.5965694508612,
+ 41.195851006618,
+ 198.908340256866,
+ 191.981840681226,
+ 30.8315816067175,
+ 113.887338426401,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 9.92029297553869,
+ 19.7400483331064,
+ 100.386558093686,
+ 15.4068400875812,
+ 18.3569639068771,
+ 96.2830954078732,
+ 16.962754226054,
+ 18.0623538012876,
+ 95.0217913749899,
+ 38.2076107233431,
+ 16.4928838085727,
+ 75.3464048704157,
+ 62.3208239731381,
+ 11.2735952280151,
+ 56.4524802011783,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 9.87508327949836,
+ 14.3192353964892,
+ 59.1464514515102,
+ 11.2675056435235,
+ 14.8125191759469,
+ 57.2607453080274,
+ 4.14769665520673,
+ 15.8715784694538,
+ 63.3214950028372,
+ 29.5291244255024,
+ 11.3995424297982,
+ 42.4121032721972,
+ 40.1703043219586,
+ 6.0243791126203,
+ 37.1460866929189,
+ 8.26652216766441,
+ 92.1124289304242,
+ 583.886280923837,
+ 44.7633542317244,
+ 89.2159585232686,
+ 550.285919266933,
+ 72.9724640027403,
+ 80.8641530548241,
+ 530.428614964361,
+ 262.725838840513,
+ 50.8439220326181,
+ 370.695471148794,
+ 344.509723255133,
+ 53.429683427805,
+ 286.325825338988,
+ 11.6790564287239,
+ 65.9042793868665,
+ 430.612851224218,
+ 48.452820418072,
+ 61.5098859751909,
+ 398.233480646545,
+ 97.9831080092136,
+ 51.6630334093814,
+ 358.550045621213,
+ 230.195652788106,
+ 35.9405577337742,
+ 242.059976517927,
+ 189.120896455771,
+ 61.0321581081886,
+ 258.043132475847,
+ 0.869333895168885,
+ 37.9965481053825,
+ 217.285029407888,
+ 22.1642925767926,
+ 34.8859208038335,
+ 199.100698027813,
+ 18.7527707015473,
+ 37.0589027279744,
+ 200.339237978918,
+ 59.7511446072099,
+ 30.1847053283278,
+ 166.215061472902,
+ 167.052340508241,
+ 14.507333877119,
+ 74.5912370230791,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 2.42933078007588,
+ 5.73235617508201,
+ 15.6761902934751,
+ 1.49850936604462,
+ 5.73235617508201,
+ 16.6070117075063,
+ 1.17914212726958,
+ 4.55321404781243,
+ 18.105521073551,
+ 6.30300052058957,
+ 3.66832493590669,
+ 13.8665517921367,
+ 12.4278944546533,
+ 3.2431733664449,
+ 8.16680942753475,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 8.39573480666894,
+ 15.4952298170233,
+ 52.2126508237706,
+ 9.63714424049469,
+ 13.5299057251883,
+ 52.9365654817798,
+ 9.44718715255943,
+ 16.423348084818,
+ 50.2330802100854,
+ 20.2725788355165,
+ 15.5173619618845,
+ 40.3136746500617,
+ 38.2927497189588,
+ 11.7829715350995,
+ 26.0278941934044,
+ 19.8790071809217,
+ 101.463116569833,
+ 690.602976143096,
+ 56.2163206284992,
+ 101.079268064969,
+ 654.649511200382,
+ 83.0535948165,
+ 92.0948878952942,
+ 636.796617182056,
+ 305.193372894763,
+ 61.7735922552134,
+ 444.978134743874,
+ 409.640858024675,
+ 58.4146893501378,
+ 343.889552519038,
+ 9.90621597892775,
+ 55.0278610296194,
+ 373.394659352381,
+ 47.5206499389839,
+ 49.7954153803178,
+ 341.012671041626,
+ 87.6132785569048,
+ 44.5474174001837,
+ 306.168040403839,
+ 195.2019421789,
+ 28.533287182771,
+ 214.593506999257,
+ 161.147898277143,
+ 46.105052664534,
+ 231.075785419251,
+ 0,
+ 52.3539765607115,
+ 259.430694488416,
+ 27.1821887836713,
+ 48.6443030395595,
+ 235.958179225897,
+ 29.5255909415281,
+ 45.9011540348131,
+ 236.357926072787,
+ 93.4384769549071,
+ 35.3690449973153,
+ 182.977149096906,
+ 181.664688038812,
+ 26.7212628375317,
+ 103.398720172784,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 2.48602468962541,
+ 4.19192804715235,
+ 29.2975988261611,
+ 3.35752276599355,
+ 4.40276191314031,
+ 28.215266883805,
+ 2.48488123654107,
+ 4.74684536925195,
+ 28.7438249571458,
+ 9.79314957086999,
+ 4.39606372450688,
+ 21.786338267562,
+ 19.7467025646989,
+ 2.88369251029536,
+ 13.3451564879445,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 9.7803012222566,
+ 6.15339934156018,
+ 44.0999854612128,
+ 3.90892821413032,
+ 9.76028796541731,
+ 46.364469845482,
+ 10.0914706410191,
+ 7.70574241452484,
+ 42.2364729694857,
+ 15.859766758229,
+ 9.20425178056946,
+ 34.9696674862312,
+ 29.7415054659447,
+ 3.60688862385713,
+ 26.6852919352278,
+ 16.4479903421807,
+ 104.780079711006,
+ 665.300707451108,
+ 56.4011671534055,
+ 98.8446927148957,
+ 631.282917635994,
+ 69.5019838118314,
+ 90.4826917485473,
+ 626.544101943917,
+ 302.819307729484,
+ 57.2636975473541,
+ 426.445772227457,
+ 393.969196389827,
+ 65.6359015405782,
+ 326.923679573891,
+ 11.8959724925315,
+ 68.1512334899437,
+ 387.58261153286,
+ 46.4212628337103,
+ 59.4260278916545,
+ 361.78252678997,
+ 94.5383231761747,
+ 56.9508276865298,
+ 316.14066665263,
+ 199.684866385115,
+ 39.1206672034273,
+ 228.824283926792,
+ 179.84721102297,
+ 58.1884131325316,
+ 229.594193359833,
+ 0,
+ 46.7958995626063,
+ 265.036267829797,
+ 31.965931990454,
+ 46.3474779000091,
+ 233.51875750194,
+ 34.2021347291957,
+ 43.6339142440675,
+ 233.99611841914,
+ 92.252280940977,
+ 34.8769310772332,
+ 184.702955374193,
+ 179.869473070801,
+ 15.9522539464857,
+ 116.010440375116,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
}
+ },
+ "n_missing": 2
}
+ },
+ "missing": 2,
+ "n": 1662
}
-}
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/ca-x-mr.json b/tests/fixtures/ca-x-mr.json
index b374deef0..19481fae8 100644
--- a/tests/fixtures/ca-x-mr.json
+++ b/tests/fixtures/ca-x-mr.json
@@ -1,974 +1,959 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d8%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d8%2F%22%7D,%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dd%2F%22%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dd%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d0%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
+ "query": {
+ "dimensions": [
+ {
+ "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
+ },
+ {
+ "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ },
+ "result": {
+ "counts": [
+ 34,
+ 21,
+ 257,
+ 29,
+ 23,
+ 260,
+ 251,
+ 6,
+ 55,
+ 0,
+ 0,
+ 312,
+ 39,
+ 36,
+ 340,
+ 43,
+ 35,
+ 337,
+ 335,
+ 11,
+ 69,
+ 0,
+ 0,
+ 415,
+ 26,
+ 23,
+ 222,
+ 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 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 143,
+ 128,
+ 1391,
+ 141,
+ 126,
+ 1395,
+ 1389,
+ 33,
+ 240,
+ 0,
+ 0,
+ 1662
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "abolitionists",
+ "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
+ "name": "Abolitionists",
+ "notes": "A categorical array variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ },
+ {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
+ },
+ {
+ "alias": "truth",
+ "name": "Sojourner Truth"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false
+ }
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0061",
+ "references": {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0062",
+ "references": {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
}
+ }
},
- "dimensions": [
- {
- "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d8/"
- },
- {
- "each": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
- },
- {
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dd/"
- }
- ]
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "fb4492a07d5142f9a9a49de9c07ce8a1",
+ "references": {
+ "alias": "truth",
+ "name": "Sojourner Truth"
}
- ],
- "weight": "https://alpha.crunch.io/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "abolitionists",
+ "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
+ "name": "Abolitionists",
+ "notes": "A categorical array variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "douglass",
+ "description": "fav_ppdem",
+ "name": "Frederick Douglass"
+ },
+ {
+ "alias": "brown",
+ "description": "fav_pprep",
+ "name": "John Brown"
+ },
+ {
+ "alias": "truth",
+ "name": "Sojourner Truth"
+ }
+ ],
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false
+ }
},
- "query_environment": {
- "filter": [
-
- ]
+ "type": {
+ "categories": [
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Very favorable",
+ "numeric_value": 0,
+ "selected": false
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Somewhat favorable",
+ "numeric_value": 2,
+ "selected": false
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "Somewhat unfavorable",
+ "numeric_value": 3,
+ "selected": false
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Very unfavorable",
+ "numeric_value": 4,
+ "selected": false
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Don't know",
+ "numeric_value": 5,
+ "selected": false
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": 32766,
+ "selected": false
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": 32767,
+ "selected": false
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null,
+ "selected": false
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0061",
+ "0062",
+ "fb4492a07d5142f9a9a49de9c07ce8a1"
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "1984_countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "Countries from 1984",
+ "notes": "A multiple response variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ },
+ {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
+ },
+ {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
+ },
+ {
+ "alias": "disputed",
+ "name": "Disputed"
+ }
+ ],
+ "uniform_basis": false
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
- "subreferences": [
- {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- {
- "alias": "truth",
- "name": "Sojourner Truth"
- }
- ],
- "notes": "A categorical array variable, where one item has no responses",
- "name": "Abolitionists",
- "alias": "abolitionists",
- "view": {
- "show_counts": false,
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- "id": "0061"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- "id": "0062"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "truth",
- "name": "Sojourner Truth"
- },
- "id": "fb4492a07d5142f9a9a49de9c07ce8a1"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": false,
- "references": {
- "description": "Do you have a favorable or an unfavorable opinion of the following abolitionists?",
- "subreferences": [
- {
- "alias": "douglass",
- "name": "Frederick Douglass",
- "description": "fav_ppdem"
- },
- {
- "alias": "brown",
- "name": "John Brown",
- "description": "fav_pprep"
- },
- {
- "alias": "truth",
- "name": "Sojourner Truth"
- }
- ],
- "notes": "A categorical array variable, where one item has no responses",
- "name": "Abolitionists",
- "alias": "abolitionists",
- "view": {
- "show_counts": false,
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0061",
- "0062",
- "fb4492a07d5142f9a9a49de9c07ce8a1"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 0,
- "selected": false,
- "id": 0,
- "name": "Very favorable",
- "missing": false
- },
- {
- "numeric_value": 2,
- "selected": false,
- "id": 2,
- "name": "Somewhat favorable",
- "missing": false
- },
- {
- "numeric_value": 3,
- "selected": false,
- "id": 3,
- "name": "Somewhat unfavorable",
- "missing": false
- },
- {
- "numeric_value": 4,
- "selected": false,
- "id": 4,
- "name": "Very unfavorable",
- "missing": false
- },
- {
- "numeric_value": 5,
- "selected": false,
- "id": 5,
- "name": "Don't know",
- "missing": false
- },
- {
- "numeric_value": 32766,
- "selected": false,
- "id": 32766,
- "name": "skipped",
- "missing": true
- },
- {
- "numeric_value": 32767,
- "selected": false,
- "id": 32767,
- "name": "not asked",
- "missing": true
- },
- {
- "numeric_value": null,
- "selected": false,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- {
- "alias": "disputed",
- "name": "Disputed"
- }
- ],
- "notes": "A multiple response variable, where one item has no responses",
- "alias": "1984_countries",
- "name": "Countries from 1984"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- "id": "00c5"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- "id": "00c6"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- "id": "00c7"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "disputed",
- "name": "Disputed"
- },
- "id": "11b45a85e5ac4011bd3cf884b8a2476f"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "references": {
- "uniform_basis": false,
- "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
- "subreferences": [
- {
- "alias": "eurasia",
- "name": "Eurasia",
- "description": "union_hhold_1"
- },
- {
- "alias": "oceania",
- "name": "Oceania",
- "description": "union_hhold_2"
- },
- {
- "alias": "eastasia",
- "name": "Eastasia",
- "description": "union_hhold_3"
- },
- {
- "alias": "disputed",
- "name": "Disputed"
- }
- ],
- "notes": "A multiple response variable, where one item has no responses",
- "alias": "1984_countries",
- "name": "Countries from 1984"
- },
- "derived": true,
- "type": {
- "ordinal": false,
- "subvariables": [
- "00c5",
- "00c6",
- "00c7",
- "11b45a85e5ac4011bd3cf884b8a2476f"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Not Selected"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c5",
+ "references": {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c6",
+ "references": {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
+ }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c7",
+ "references": {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
}
- ],
- "missing": 10,
- "measures": {
- "count": {
- "data": [
- 22.2609925032701,
- 16.9844835303167,
- 222.310511064138,
- 21.4670764652966,
- 18.7623471388787,
- 221.32656349355,
- 219.182324478491,
- 3.19926616430062,
- 39.1743964549334,
- 0,
- 0,
- 261.555987097725,
- 34.4602057043984,
- 38.9081180709724,
- 318.459577115524,
- 44.0133766327096,
- 40.2937863255125,
- 307.520737932672,
- 314.365248914328,
- 11.0374449013001,
- 66.4252070752666,
- 0,
- 0,
- 391.827900890895,
- 25.5630888770301,
- 35.7209072453127,
- 202.837216191128,
- 25.335068002585,
- 30.4374108415629,
- 208.348733469323,
- 217.584012509558,
- 8.94596533741205,
- 37.5912344665001,
- 0,
- 0,
- 264.121212313471,
- 32.4017181382625,
- 31.0352661360065,
- 438.013129815619,
- 33.841067995359,
- 33.331393844497,
- 434.277652250033,
- 438.909164860856,
- 5.0196677412525,
- 57.5212814877798,
- 0,
- 0,
- 501.450114089889,
- 4.99112939798944,
- 28.002444742699,
- 179.351243978733,
- 8.54509709144171,
- 26.3461434771868,
- 177.453577550793,
- 198.80859162999,
- 1.65630126551221,
- 11.8799252239189,
- 0,
- 0,
- 212.344818119421,
- 0.752560977946403,
- 6.91918433229187,
- 23.0282221783644,
- 3.60847290734546,
- 5.74004220502229,
- 21.351452376235,
- 23.6917151822036,
- 3.82636054837688,
- 3.18189175802228,
- 0,
- 0,
- 30.6999674886027,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 15.1064515178025,
- 14.8964289544671,
- 140.995495924001,
- 21.0230096950105,
- 12.9669188119134,
- 137.008447889347,
- 135.917515423371,
- 3.7245122738576,
- 31.3563486990416,
- 0,
- 0,
- 170.998376396271,
- 32.5604100093203,
- 41.4234601652912,
- 329.92570090253,
- 34.3230034411795,
- 41.2112974042019,
- 328.37527023176,
- 338.33312724915,
- 9.33037214070239,
- 56.2460716872887,
- 0,
- 0,
- 403.909571077141,
- 25.1241675577809,
- 28.2218351521075,
- 215.050092465812,
- 29.5531524247545,
- 26.870502142431,
- 211.972440608514,
- 217.765472615634,
- 8.59861013012241,
- 42.0320124299436,
- 0,
- 0,
- 268.3960951757,
- 41.5686964119083,
- 41.9334112591193,
- 486.723309333154,
- 40.0469902636259,
- 43.5846394210477,
- 486.593787319508,
- 492.635593733922,
- 6.88919293488811,
- 70.7006303353718,
- 0,
- 0,
- 570.225417004182,
- 5.23117131012065,
- 28.002444742699,
- 187.651851514459,
- 8.22537078190222,
- 26.3461434771868,
- 186.31395330819,
- 207.428925475256,
- 1.65630126551221,
- 11.8002408265107,
- 0,
- 0,
- 220.885467567279,
- 0.838798791964368,
- 3.09282378391499,
- 23.6534502035512,
- 3.63863248826485,
- 3.93162257587936,
- 20.0148177152864,
- 20.460423078094,
- 3.48601721307167,
- 3.63863248826485,
- 0,
- 0,
- 27.5850727794306,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 120.429695598897,
- 157.570404057599,
- 1383.9999003435,
- 136.810159094737,
- 154.91112383266,
- 1370.2787170726,
- 1412.54105757542,
- 33.6850059581544,
- 215.773936466421,
- 0,
- 0,
- 1661.99999999999
- ],
- "n_missing": 10,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ }
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "11b45a85e5ac4011bd3cf884b8a2476f",
+ "references": {
+ "alias": "disputed",
+ "name": "Disputed"
}
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "1984_countries",
+ "description": "Which of the following countries from 1984 would you live in? (select all that apply)",
+ "name": "Countries from 1984",
+ "notes": "A multiple response variable, where one item has no responses",
+ "subreferences": [
+ {
+ "alias": "eurasia",
+ "description": "union_hhold_1",
+ "name": "Eurasia"
+ },
+ {
+ "alias": "oceania",
+ "description": "union_hhold_2",
+ "name": "Oceania"
+ },
+ {
+ "alias": "eastasia",
+ "description": "union_hhold_3",
+ "name": "Eastasia"
+ },
+ {
+ "alias": "disputed",
+ "name": "Disputed"
+ }
+ ],
+ "uniform_basis": false
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Not Selected",
+ "numeric_value": 0
},
- "element": "crunch:cube",
- "counts": [
- 34,
- 21,
- 257,
- 29,
- 23,
- 260,
- 251,
- 6,
- 55,
- 0,
- 0,
- 312,
- 39,
- 36,
- 340,
- 43,
- 35,
- 337,
- 335,
- 11,
- 69,
- 0,
- 0,
- 415,
- 26,
- 23,
- 222,
- 26,
- 20,
- 225,
- 223,
- 7,
- 41,
- 0,
- 0,
- 271,
- 37,
- 26,
- 427,
- 33,
- 28,
- 429,
- 424,
- 6,
- 60,
- 0,
- 0,
- 490,
- 6,
- 18,
- 129,
- 7,
- 17,
- 129,
- 140,
- 1,
- 12,
- 0,
- 0,
- 153,
- 1,
- 4,
- 16,
- 3,
- 3,
- 15,
- 16,
- 2,
- 3,
- 0,
- 0,
- 21,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 15,
- 16,
- 141,
- 19,
- 14,
- 139,
- 139,
- 5,
- 28,
- 0,
- 0,
- 172,
- 36,
- 35,
- 288,
- 31,
- 35,
- 293,
- 294,
- 8,
- 57,
- 0,
- 0,
- 359,
- 23,
- 25,
- 234,
- 30,
- 23,
- 229,
- 233,
- 7,
- 42,
- 0,
- 0,
- 282,
- 62,
- 32,
- 573,
- 50,
- 34,
- 583,
- 560,
- 10,
- 97,
- 0,
- 0,
- 667,
- 6,
- 18,
- 135,
- 7,
- 17,
- 135,
- 146,
- 1,
- 12,
- 0,
- 0,
- 159,
- 1,
- 2,
- 20,
- 4,
- 3,
- 16,
- 17,
- 2,
- 4,
- 0,
- 0,
- 23,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 143,
- 128,
- 1391,
- 141,
- 126,
- 1395,
- 1389,
- 33,
- 240,
- 0,
- 0,
- 1662
- ],
- "n": 1662
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00c5",
+ "00c6",
+ "00c7",
+ "11b45a85e5ac4011bd3cf884b8a2476f"
+ ]
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 22.2609925032701,
+ 16.9844835303167,
+ 222.310511064138,
+ 21.4670764652966,
+ 18.7623471388787,
+ 221.32656349355,
+ 219.182324478491,
+ 3.19926616430062,
+ 39.1743964549334,
+ 0,
+ 0,
+ 261.555987097725,
+ 34.4602057043984,
+ 38.9081180709724,
+ 318.459577115524,
+ 44.0133766327096,
+ 40.2937863255125,
+ 307.520737932672,
+ 314.365248914328,
+ 11.0374449013001,
+ 66.4252070752666,
+ 0,
+ 0,
+ 391.827900890895,
+ 25.5630888770301,
+ 35.7209072453127,
+ 202.837216191128,
+ 25.335068002585,
+ 30.4374108415629,
+ 208.348733469323,
+ 217.584012509558,
+ 8.94596533741205,
+ 37.5912344665001,
+ 0,
+ 0,
+ 264.121212313471,
+ 32.4017181382625,
+ 31.0352661360065,
+ 438.013129815619,
+ 33.841067995359,
+ 33.331393844497,
+ 434.277652250033,
+ 438.909164860856,
+ 5.0196677412525,
+ 57.5212814877798,
+ 0,
+ 0,
+ 501.450114089889,
+ 4.99112939798944,
+ 28.002444742699,
+ 179.351243978733,
+ 8.54509709144171,
+ 26.3461434771868,
+ 177.453577550793,
+ 198.80859162999,
+ 1.65630126551221,
+ 11.8799252239189,
+ 0,
+ 0,
+ 212.344818119421,
+ 0.752560977946403,
+ 6.91918433229187,
+ 23.0282221783644,
+ 3.60847290734546,
+ 5.74004220502229,
+ 21.351452376235,
+ 23.6917151822036,
+ 3.82636054837688,
+ 3.18189175802228,
+ 0,
+ 0,
+ 30.6999674886027,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 15.1064515178025,
+ 14.8964289544671,
+ 140.995495924001,
+ 21.0230096950105,
+ 12.9669188119134,
+ 137.008447889347,
+ 135.917515423371,
+ 3.7245122738576,
+ 31.3563486990416,
+ 0,
+ 0,
+ 170.998376396271,
+ 32.5604100093203,
+ 41.4234601652912,
+ 329.92570090253,
+ 34.3230034411795,
+ 41.2112974042019,
+ 328.37527023176,
+ 338.33312724915,
+ 9.33037214070239,
+ 56.2460716872887,
+ 0,
+ 0,
+ 403.909571077141,
+ 25.1241675577809,
+ 28.2218351521075,
+ 215.050092465812,
+ 29.5531524247545,
+ 26.870502142431,
+ 211.972440608514,
+ 217.765472615634,
+ 8.59861013012241,
+ 42.0320124299436,
+ 0,
+ 0,
+ 268.3960951757,
+ 41.5686964119083,
+ 41.9334112591193,
+ 486.723309333154,
+ 40.0469902636259,
+ 43.5846394210477,
+ 486.593787319508,
+ 492.635593733922,
+ 6.88919293488811,
+ 70.7006303353718,
+ 0,
+ 0,
+ 570.225417004182,
+ 5.23117131012065,
+ 28.002444742699,
+ 187.651851514459,
+ 8.22537078190222,
+ 26.3461434771868,
+ 186.31395330819,
+ 207.428925475256,
+ 1.65630126551221,
+ 11.8002408265107,
+ 0,
+ 0,
+ 220.885467567279,
+ 0.838798791964368,
+ 3.09282378391499,
+ 23.6534502035512,
+ 3.63863248826485,
+ 3.93162257587936,
+ 20.0148177152864,
+ 20.460423078094,
+ 3.48601721307167,
+ 3.63863248826485,
+ 0,
+ 0,
+ 27.5850727794306,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 120.429695598897,
+ 157.570404057599,
+ 1383.9999003435,
+ 136.810159094737,
+ 154.91112383266,
+ 1370.2787170726,
+ 1412.54105757542,
+ 33.6850059581544,
+ 215.773936466421,
+ 0,
+ 0,
+ 1661.99999999999
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 10
+ }
+ },
+ "missing": 10,
+ "n": 1662
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/ca-x-single-cat.json b/tests/fixtures/ca-x-single-cat.json
index aba97c19b..5418ad24b 100644
--- a/tests/fixtures/ca-x-single-cat.json
+++ b/tests/fixtures/ca-x-single-cat.json
@@ -1,279 +1,264 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F0063c146f72945b7a54dbe7edb35e15c%2Fvariables%2F00000b%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F0063c146f72945b7a54dbe7edb35e15c%2Fvariables%2F00000b%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F0063c146f72945b7a54dbe7edb35e15c%2Fvariables%2F3dc48bd3ebb74966ab55de5f69e47561%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
+ "query": {
+ "dimensions": [
+ {
+ "each": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/00000b/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/00000b/"
+ },
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/3dc48bd3ebb74966ab55de5f69e47561/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": null
+ },
+ "result": {
+ "counts": [
+ 13,
+ 32,
+ 0,
+ 12,
+ 22,
+ 0,
+ 8,
+ 13,
+ 0,
+ 16,
+ 24,
+ 0,
+ 12,
+ 28,
+ 0,
+ 5,
+ 15,
+ 0,
+ 11,
+ 21,
+ 0,
+ 12,
+ 26,
+ 0,
+ 10,
+ 20,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": true,
+ "references": {
+ "alias": "pets_array",
+ "description": "Pets Array",
+ "is_dichotomous": false,
+ "name": "pets_array",
+ "subreferences": [
+ {
+ "alias": "a_cat",
+ "description": "a_cat",
+ "name": "cat"
+ },
+ {
+ "alias": "a_dog",
+ "description": "a_dog",
+ "name": "dog"
+ },
+ {
+ "alias": "a_wombat",
+ "description": "a_wombat",
+ "name": "wombat"
+ }
+ ]
+ },
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0003",
+ "references": {
+ "alias": "a_cat",
+ "description": "a_cat",
+ "name": "cat"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0004",
+ "references": {
+ "alias": "a_dog",
+ "description": "a_dog",
+ "name": "dog"
}
+ }
},
- "dimensions": [
- {
- "each": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/00000b/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/00000b/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/0063c146f72945b7a54dbe7edb35e15c/variables/3dc48bd3ebb74966ab55de5f69e47561/"
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "0005",
+ "references": {
+ "alias": "a_wombat",
+ "description": "a_wombat",
+ "name": "wombat"
}
- ],
- "weight": null
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "pets_array",
+ "description": "Pets Array",
+ "is_dichotomous": false,
+ "name": "pets_array",
+ "subreferences": [
+ {
+ "alias": "a_cat",
+ "description": "a_cat",
+ "name": "cat"
+ },
+ {
+ "alias": "a_dog",
+ "description": "a_dog",
+ "name": "dog"
+ },
+ {
+ "alias": "a_wombat",
+ "description": "a_wombat",
+ "name": "wombat"
+ }
+ ]
},
- "query_environment": {
- "filter": [
-
- ]
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "not selected",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "selected",
+ "numeric_value": 2
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "0003",
+ "0004",
+ "0005"
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Fruit Single CAT",
+ "description": "Fruits",
+ "name": "Fruit Single CAT"
},
- "result": {
- "dimensions": [
- {
- "derived": true,
- "references": {
- "alias": "pets_array",
- "subreferences": [
- {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- }
- ],
- "is_dichotomous": false,
- "description": "Pets Array",
- "name": "pets_array"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- "id": "0003"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- "id": "0004"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- },
- "id": "0005"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "derived": false,
- "references": {
- "alias": "pets_array",
- "is_dichotomous": false,
- "description": "Pets Array",
- "name": "pets_array",
- "subreferences": [
- {
- "alias": "a_cat",
- "name": "cat",
- "description": "a_cat"
- },
- {
- "alias": "a_dog",
- "name": "dog",
- "description": "a_dog"
- },
- {
- "alias": "a_wombat",
- "name": "wombat",
- "description": "a_wombat"
- }
- ]
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "0003",
- "0004",
- "0005"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "not selected"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "selected"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- },
- {
- "derived": true,
- "references": {
- "alias": "Fruit Single CAT",
- "name": "Fruit Single CAT",
- "description": "Fruits"
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "missing": false,
- "id": 1,
- "name": "rambutan"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": 2,
- "name": "satsuma"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 70,
- "measures": {
- "count": {
- "data": [
- 13,
- 32,
- 0,
- 12,
- 22,
- 0,
- 8,
- 13,
- 0,
- 16,
- 24,
- 0,
- 12,
- 28,
- 0,
- 5,
- 15,
- 0,
- 11,
- 21,
- 0,
- 12,
- 26,
- 0,
- 10,
- 20,
- 0
- ],
- "n_missing": 70,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "rambutan",
+ "numeric_value": null
+ },
+ {
+ "id": 2,
+ "missing": true,
+ "name": "satsuma",
+ "numeric_value": null
},
- "element": "crunch:cube",
- "counts": [
- 13,
- 32,
- 0,
- 12,
- 22,
- 0,
- 8,
- 13,
- 0,
- 16,
- 24,
- 0,
- 12,
- 28,
- 0,
- 5,
- 15,
- 0,
- 11,
- 21,
- 0,
- 12,
- 26,
- 0,
- 10,
- 20,
- 0
- ],
- "n": 100
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 13,
+ 32,
+ 0,
+ 12,
+ 22,
+ 0,
+ 8,
+ 13,
+ 0,
+ 16,
+ 24,
+ 0,
+ 12,
+ 28,
+ 0,
+ 5,
+ 15,
+ 0,
+ 11,
+ 21,
+ 0,
+ 12,
+ 26,
+ 0,
+ 10,
+ 20,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 70
+ }
+ },
+ "missing": 70,
+ "n": 100
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/cat-hs-x-mr-augmented-wgtd.json b/tests/fixtures/cat-hs-x-mr-augmented-wgtd.json
index a4aab5859..8839281eb 100644
--- a/tests/fixtures/cat-hs-x-mr-augmented-wgtd.json
+++ b/tests/fixtures/cat-hs-x-mr-augmented-wgtd.json
@@ -1,1497 +1,1456 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F0yADwLRARYg8QMoiERXLx3000107%2F%22%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F0yADwLRARYg8QMoiERXLx300011d%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx3000107/"
},
- "dimensions": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx3000107/"
- },
- {
- "function": "dimension",
- "args": [
- {
- "function": "as_selected",
- "args": [
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
+ },
+ "result": {
+ "counts": [
+ 711,
+ 0,
+ 0,
+ 489,
+ 222,
+ 0,
+ 142,
+ 569,
+ 0,
+ 0,
+ 694,
+ 0,
+ 75,
+ 619,
+ 0,
+ 220,
+ 474,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 489,
+ 75,
+ 0,
+ 564,
+ 0,
+ 0,
+ 111,
+ 453,
+ 0,
+ 222,
+ 619,
+ 0,
+ 0,
+ 841,
+ 0,
+ 251,
+ 590,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 142,
+ 220,
+ 0,
+ 111,
+ 251,
+ 0,
+ 362,
+ 0,
+ 0,
+ 569,
+ 474,
+ 0,
+ 453,
+ 590,
+ 0,
+ 0,
+ 1043,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1744,
+ 0,
+ 0,
+ 1289,
+ 455,
+ 0,
+ 372,
+ 1372,
+ 0,
+ 0,
+ 2169,
+ 0,
+ 196,
+ 1973,
+ 0,
+ 914,
+ 1255,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1289,
+ 196,
+ 0,
+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 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "F_AGECAT",
+ "description": "Age category",
+ "name": "F_AGECAT",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": "top",
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "18–49"
+ },
+ {
+ "anchor": "top",
+ "args": [
+ 3,
+ 4
+ ],
+ "function": "subtotal",
+ "name": "≥50"
+ },
+ {
+ "anchor": 2,
+ "args": [
+ 3,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "test12"
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ "anchor": "bottom",
+ "args": [
+ 4,
+ 99
+ ],
+ "function": "subtotal",
+ "name": "test"
}
]
- },
- {
- "value": "subvariables"
}
- ]
+ }
},
- {
- "function": "as_selected",
- "args": [
+ "type": {
+ "categories": [
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
- }
- ]
- },
- {
- "function": "dimension",
- "args": [
+ "id": 1,
+ "missing": false,
+ "name": "18-29",
+ "numeric_value": 1
+ },
{
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
- }
- ]
+ "id": 2,
+ "missing": false,
+ "name": "30-49",
+ "numeric_value": 2
},
{
- "value": "subvariables"
- }
- ]
- },
- {
- "function": "as_selected",
- "args": [
+ "id": 3,
+ "missing": false,
+ "name": "50-64",
+ "numeric_value": 3
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "65+",
+ "numeric_value": 4
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ "id": 99,
+ "missing": false,
+ "name": "Refused",
+ "numeric_value": 99
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
}
- ]
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- ],
- "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
- },
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "F_AGECAT",
- "description": "Age category",
- "name": "F_AGECAT",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "18–49",
- "anchor": "top"
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 4
- ],
- "name": "≥50",
- "anchor": "top"
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 2
- ],
- "name": "test12",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 4,
- 99
- ],
- "name": "test",
- "anchor": "bottom"
- }
- ]
- },
- "include_missing": false,
- "column_width": null
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
}
},
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "18-29"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "30-49"
- },
- {
- "numeric_value": 3,
- "missing": false,
- "id": 3,
- "name": "50-64"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "65+"
- },
- {
- "numeric_value": 99,
- "missing": false,
- "id": 99,
- "name": "Refused"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ },
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "references": {
- "uniform_basis": false,
- "description": null,
- "name": "Trust",
- "format": {
- "summary": {
- "digits": 0
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00000",
+ "references": {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ }
}
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00002",
+ "references": {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ }
}
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
- }
- },
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- "id": "00000"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- "id": "00002"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- },
- "id": "00001"
- },
- "missing": false
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00001",
+ "references": {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
}
- ],
- "class": "enum"
+ }
+ ],
+ "subtype": {
+ "class": "variable"
}
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": null,
- "format": {
- "summary": {
- "digits": 0
- }
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
+ },
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- }
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
},
- "name": "Trust"
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "00000",
- "00002",
- "00001"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "references": {
- "uniform_basis": false,
- "description": null,
- "name": "Trust",
- "format": {
- "summary": {
- "digits": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- }
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00000",
+ "00002",
+ "00001"
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
}
},
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- "id": "00000"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- "id": "00002"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- },
- "id": "00001"
- },
- "missing": false
- }
- ],
- "class": "enum"
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": null,
- "format": {
- "summary": {
- "digits": 0
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00000",
+ "references": {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ }
}
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00002",
+ "references": {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ }
}
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
},
- "name": "Trust"
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "00000",
- "00002",
- "00001"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00001",
+ "references": {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
}
- ]
- }
- }
- ],
- "missing": 0,
- "measures": {
- "count": {
- "data": [
- 1002.5234324131684,
- 0,
- 0,
- 645.5602359951876,
- 356.9631964179815,
- 0,
- 240.67289101199108,
- 761.8505414011779,
- 0,
- 0,
- 1247.7916049952876,
- 0,
- 120.39056204551068,
- 1127.401042949778,
- 0,
- 415.7664839603485,
- 832.0251210349411,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 645.5602359951876,
- 120.39056204551068,
- 0,
- 765.9507980406985,
- 0,
- 0,
- 185.25535349052006,
- 580.6954445501777,
- 0,
- 356.9631964179815,
- 1127.401042949778,
- 0,
- 0,
- 1484.3642393677555,
- 0,
- 471.1840214818194,
- 1013.1802178859404,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 240.67289101199108,
- 415.7664839603485,
- 0,
- 185.25535349052006,
- 471.1840214818194,
- 0,
- 656.4393749723399,
- 0,
- 0,
- 761.8505414011779,
- 832.0251210349411,
- 0,
- 580.6954445501777,
- 1013.1802178859404,
- 0,
- 0,
- 1593.8756624361115,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1520.2348209127326,
- 0,
- 0,
- 1088.6831051455192,
- 431.55171576721705,
- 0,
- 416.88658440033595,
- 1103.3482365123994,
- 0,
- 0,
- 2573.2276224677926,
- 0,
- 202.40947405155643,
- 2370.8181484162387,
- 0,
- 1178.5575392459032,
- 1394.6700832218874,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1088.6831051455192,
- 202.40947405155643,
- 0,
- 1291.0925791970749,
- 0,
- 0,
- 337.8370954349569,
- 953.2554837621217,
- 0,
- 431.55171576721705,
- 2370.8181484162387,
- 0,
- 0,
- 2802.3698641834494,
- 0,
- 1257.6070282112817,
- 1544.7628359721687,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 416.88658440033595,
- 1178.5575392459032,
- 0,
- 337.8370954349569,
- 1257.6070282112817,
- 0,
- 1595.4441236462358,
- 0,
- 0,
- 1103.3482365123994,
- 1394.6700832218874,
- 0,
- 953.2554837621217,
- 1544.7628359721687,
- 0,
- 0,
- 2498.0183197342967,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 908.6566750086301,
- 0,
- 0,
- 699.1064519467798,
- 209.55022306184983,
- 0,
- 261.88391990858304,
- 646.7727551000474,
- 0,
- 0,
- 2254.626234708468,
- 0,
- 142.65793991683756,
- 2111.9682947916294,
- 0,
- 1341.9120476404512,
- 912.7141870680143,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 699.1064519467798,
- 142.65793991683756,
- 0,
- 841.7643918636179,
- 0,
- 0,
- 214.58026555613168,
- 627.1841263074863,
- 0,
- 209.55022306184983,
- 2111.9682947916294,
- 0,
- 0,
- 2321.5185178534775,
- 0,
- 1389.2157019929016,
- 932.3028158605755,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 261.88391990858304,
- 1341.9120476404512,
- 0,
- 214.58026555613168,
- 1389.2157019929016,
- 0,
- 1603.7959675490333,
- 0,
- 0,
- 646.7727551000474,
- 912.7141870680143,
- 0,
- 627.1841263074863,
- 932.3028158605755,
- 0,
- 0,
- 1559.4869421680564,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 746.8900823558639,
- 0,
- 0,
- 604.9871915620402,
- 141.90289079382256,
- 0,
- 124.00836666649133,
- 622.8817156893717,
- 0,
- 0,
- 1753.2632224112933,
- 0,
- 116.3952893029048,
- 1636.8679331083893,
- 0,
- 1131.8620227754368,
- 621.4011996358547,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 604.9871915620402,
- 116.3952893029048,
- 0,
- 721.3824808649454,
- 0,
- 0,
- 118.44696552131786,
- 602.9355153436267,
- 0,
- 141.90289079382256,
- 1636.8679331083893,
- 0,
- 0,
- 1778.770823902211,
- 0,
- 1137.4234239206107,
- 641.3473999815998,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 124.00836666649133,
- 1131.8620227754368,
- 0,
- 118.44696552131786,
- 1137.4234239206107,
- 0,
- 1255.8703894419277,
- 0,
- 0,
- 622.8817156893717,
- 621.4011996358547,
- 0,
- 602.9355153436267,
- 641.3473999815998,
- 0,
- 0,
- 1244.2829153252233,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 9.83166357273626,
- 0,
- 0,
- 8.05036409050453,
- 1.781299482231725,
- 0,
- 4.30851759454994,
- 5.5231459781863155,
- 0,
- 0,
- 25.955125403512575,
- 0,
- 0.18103843545111914,
- 25.774086968061457,
- 0,
- 17.90643840416656,
- 8.048686999346012,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 8.05036409050453,
- 0.18103843545111914,
- 0,
- 8.23140252595565,
- 0,
- 0,
- 3.5901487259238825,
- 4.641253800031767,
- 0,
- 1.781299482231725,
- 25.774086968061457,
- 0,
- 0,
- 27.555386450293184,
- 0,
- 18.62480727279262,
- 8.93057917750056,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 4.30851759454994,
- 17.90643840416656,
- 0,
- 3.5901487259238825,
- 18.62480727279262,
- 0,
- 22.2149559987165,
- 0,
- 0,
- 5.5231459781863155,
- 8.048686999346012,
- 0,
- 4.641253800031767,
- 8.93057917750056,
- 0,
- 0,
- 13.571832977532326,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 0,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
}
+ ],
+ "subtype": {
+ "class": "variable"
}
}
},
- "n": 12043,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
},
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ },
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- "filtered": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00000",
+ "00002",
+ "00001"
+ ]
}
- },
- "unfiltered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "filtered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "counts": [
- 711,
- 0,
- 0,
- 489,
- 222,
- 0,
- 142,
- 569,
- 0,
- 0,
- 694,
- 0,
- 75,
- 619,
- 0,
- 220,
- 474,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 489,
- 75,
- 0,
- 564,
- 0,
- 0,
- 111,
- 453,
- 0,
- 222,
- 619,
- 0,
- 0,
- 841,
- 0,
- 251,
- 590,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 142,
- 220,
- 0,
- 111,
- 251,
- 0,
- 362,
- 0,
- 0,
- 569,
- 474,
- 0,
- 453,
- 590,
- 0,
- 0,
- 1043,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1744,
- 0,
- 0,
- 1289,
- 455,
- 0,
- 372,
- 1372,
- 0,
- 0,
- 2169,
- 0,
- 196,
- 1973,
- 0,
- 914,
- 1255,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1289,
- 196,
- 0,
- 1485,
- 0,
- 0,
- 306,
- 1179,
- 0,
- 455,
- 1973,
- 0,
- 0,
- 2428,
- 0,
- 980,
- 1448,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 372,
- 914,
- 0,
- 306,
- 980,
- 0,
- 1286,
- 0,
- 0,
- 1372,
- 1255,
- 0,
- 1179,
- 1448,
- 0,
- 0,
- 2627,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1375,
- 0,
- 0,
- 1098,
- 277,
- 0,
- 242,
- 1133,
- 0,
- 0,
- 2212,
- 0,
- 193,
- 2019,
- 0,
- 1245,
- 967,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1098,
- 193,
- 0,
- 1291,
- 0,
- 0,
- 217,
- 1074,
- 0,
- 277,
- 2019,
- 0,
- 0,
- 2296,
- 0,
- 1270,
- 1026,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 242,
- 1245,
- 0,
- 217,
- 1270,
- 0,
- 1487,
- 0,
- 0,
- 1133,
- 967,
- 0,
- 1074,
- 1026,
- 0,
- 0,
- 2100,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1220,
- 0,
- 0,
- 1001,
- 219,
- 0,
- 123,
- 1097,
- 0,
- 0,
- 1864,
- 0,
- 144,
- 1720,
- 0,
- 1185,
- 679,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1001,
- 144,
- 0,
- 1145,
- 0,
- 0,
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
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 1002.5234324131684,
+ 0,
+ 0,
+ 645.5602359951876,
+ 356.9631964179815,
+ 0,
+ 240.67289101199108,
+ 761.8505414011779,
+ 0,
+ 0,
+ 1247.7916049952876,
+ 0,
+ 120.39056204551068,
+ 1127.401042949778,
+ 0,
+ 415.7664839603485,
+ 832.0251210349411,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 645.5602359951876,
+ 120.39056204551068,
+ 0,
+ 765.9507980406985,
+ 0,
+ 0,
+ 185.25535349052006,
+ 580.6954445501777,
+ 0,
+ 356.9631964179815,
+ 1127.401042949778,
+ 0,
+ 0,
+ 1484.3642393677555,
+ 0,
+ 471.1840214818194,
+ 1013.1802178859404,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 240.67289101199108,
+ 415.7664839603485,
+ 0,
+ 185.25535349052006,
+ 471.1840214818194,
+ 0,
+ 656.4393749723399,
+ 0,
+ 0,
+ 761.8505414011779,
+ 832.0251210349411,
+ 0,
+ 580.6954445501777,
+ 1013.1802178859404,
+ 0,
+ 0,
+ 1593.8756624361115,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1520.2348209127326,
+ 0,
+ 0,
+ 1088.6831051455192,
+ 431.55171576721705,
+ 0,
+ 416.88658440033595,
+ 1103.3482365123994,
+ 0,
+ 0,
+ 2573.2276224677926,
+ 0,
+ 202.40947405155643,
+ 2370.8181484162387,
+ 0,
+ 1178.5575392459032,
+ 1394.6700832218874,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1088.6831051455192,
+ 202.40947405155643,
+ 0,
+ 1291.0925791970749,
+ 0,
+ 0,
+ 337.8370954349569,
+ 953.2554837621217,
+ 0,
+ 431.55171576721705,
+ 2370.8181484162387,
+ 0,
+ 0,
+ 2802.3698641834494,
+ 0,
+ 1257.6070282112817,
+ 1544.7628359721687,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 416.88658440033595,
+ 1178.5575392459032,
+ 0,
+ 337.8370954349569,
+ 1257.6070282112817,
+ 0,
+ 1595.4441236462358,
+ 0,
+ 0,
+ 1103.3482365123994,
+ 1394.6700832218874,
+ 0,
+ 953.2554837621217,
+ 1544.7628359721687,
+ 0,
+ 0,
+ 2498.0183197342967,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 908.6566750086301,
+ 0,
+ 0,
+ 699.1064519467798,
+ 209.55022306184983,
+ 0,
+ 261.88391990858304,
+ 646.7727551000474,
+ 0,
+ 0,
+ 2254.626234708468,
+ 0,
+ 142.65793991683756,
+ 2111.9682947916294,
+ 0,
+ 1341.9120476404512,
+ 912.7141870680143,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 699.1064519467798,
+ 142.65793991683756,
+ 0,
+ 841.7643918636179,
+ 0,
+ 0,
+ 214.58026555613168,
+ 627.1841263074863,
+ 0,
+ 209.55022306184983,
+ 2111.9682947916294,
+ 0,
+ 0,
+ 2321.5185178534775,
+ 0,
+ 1389.2157019929016,
+ 932.3028158605755,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 261.88391990858304,
+ 1341.9120476404512,
+ 0,
+ 214.58026555613168,
+ 1389.2157019929016,
+ 0,
+ 1603.7959675490333,
+ 0,
+ 0,
+ 646.7727551000474,
+ 912.7141870680143,
+ 0,
+ 627.1841263074863,
+ 932.3028158605755,
+ 0,
+ 0,
+ 1559.4869421680564,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 746.8900823558639,
+ 0,
+ 0,
+ 604.9871915620402,
+ 141.90289079382256,
+ 0,
+ 124.00836666649133,
+ 622.8817156893717,
+ 0,
+ 0,
+ 1753.2632224112933,
+ 0,
+ 116.3952893029048,
+ 1636.8679331083893,
+ 0,
+ 1131.8620227754368,
+ 621.4011996358547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 604.9871915620402,
+ 116.3952893029048,
+ 0,
+ 721.3824808649454,
+ 0,
+ 0,
+ 118.44696552131786,
+ 602.9355153436267,
+ 0,
+ 141.90289079382256,
+ 1636.8679331083893,
+ 0,
+ 0,
+ 1778.770823902211,
+ 0,
+ 1137.4234239206107,
+ 641.3473999815998,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 124.00836666649133,
+ 1131.8620227754368,
+ 0,
+ 118.44696552131786,
+ 1137.4234239206107,
+ 0,
+ 1255.8703894419277,
+ 0,
+ 0,
+ 622.8817156893717,
+ 621.4011996358547,
+ 0,
+ 602.9355153436267,
+ 641.3473999815998,
+ 0,
+ 0,
+ 1244.2829153252233,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 9.83166357273626,
+ 0,
+ 0,
+ 8.05036409050453,
+ 1.781299482231725,
+ 0,
+ 4.30851759454994,
+ 5.5231459781863155,
+ 0,
+ 0,
+ 25.955125403512575,
+ 0,
+ 0.18103843545111914,
+ 25.774086968061457,
+ 0,
+ 17.90643840416656,
+ 8.048686999346012,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 8.05036409050453,
+ 0.18103843545111914,
+ 0,
+ 8.23140252595565,
+ 0,
+ 0,
+ 3.5901487259238825,
+ 4.641253800031767,
+ 0,
+ 1.781299482231725,
+ 25.774086968061457,
+ 0,
+ 0,
+ 27.555386450293184,
+ 0,
+ 18.62480727279262,
+ 8.93057917750056,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 4.30851759454994,
+ 17.90643840416656,
+ 0,
+ 3.5901487259238825,
+ 18.62480727279262,
+ 0,
+ 22.2149559987165,
+ 0,
+ 0,
+ 5.5231459781863155,
+ 8.048686999346012,
+ 0,
+ 4.641253800031767,
+ 8.93057917750056,
+ 0,
+ 0,
+ 13.571832977532326,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 0
+ }
+ },
+ "missing": 0,
+ "n": 12043
}
}
\ No newline at end of file
diff --git a/tests/fixtures/cat-hs-x-mr-wgtd.json b/tests/fixtures/cat-hs-x-mr-wgtd.json
index a1420adc7..9692e479e 100644
--- a/tests/fixtures/cat-hs-x-mr-wgtd.json
+++ b/tests/fixtures/cat-hs-x-mr-wgtd.json
@@ -1,467 +1,426 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F0yADwLRARYg8QMoiERXLx3000107%2F%22%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F0yADwLRARYg8QMoiERXLx300011d%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx3000107/"
},
- "dimensions": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx3000107/"
- },
- {
- "function": "dimension",
- "args": [
- {
- "function": "as_selected",
- "args": [
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
+ },
+ "result": {
+ "counts": [
+ 711,
+ 694,
+ 0,
+ 564,
+ 841,
+ 0,
+ 362,
+ 1043,
+ 0,
+ 1744,
+ 2169,
+ 0,
+ 1485,
+ 2428,
+ 0,
+ 1286,
+ 2627,
+ 0,
+ 1375,
+ 2212,
+ 0,
+ 1291,
+ 2296,
+ 0,
+ 1487,
+ 2100,
+ 0,
+ 1220,
+ 1864,
+ 0,
+ 1145,
+ 1939,
+ 0,
+ 1308,
+ 1776,
+ 0,
+ 24,
+ 30,
+ 0,
+ 16,
+ 38,
+ 0,
+ 22,
+ 32,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "F_AGECAT",
+ "description": "Age category",
+ "name": "F_AGECAT",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": "top",
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "18–49"
+ },
+ {
+ "anchor": "top",
+ "args": [
+ 3,
+ 4
+ ],
+ "function": "subtotal",
+ "name": "≥50"
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ "anchor": 2,
+ "args": [
+ 3,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "test12"
+ },
+ {
+ "anchor": "bottom",
+ "args": [
+ 4,
+ 99
+ ],
+ "function": "subtotal",
+ "name": "test"
}
]
- },
- {
- "value": "subvariables"
}
- ]
+ }
},
- {
- "function": "as_selected",
- "args": [
+ "type": {
+ "categories": [
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
- }
- ]
- }
- ],
- "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
- },
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "derived": false,
- "references": {
- "alias": "F_AGECAT",
- "view": {
- "show_counts": false,
- "column_width": null,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "18–49",
- "anchor": "top"
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 4
- ],
- "name": "≥50",
- "anchor": "top"
- },
- {
- "function": "subtotal",
- "args": [
- 3,
- 2
- ],
- "name": "test12",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 4,
- 99
- ],
- "name": "test",
- "anchor": "bottom"
- }
- ]
- },
- "include_missing": false,
- "show_numeric_values": false
+ "_id": 0,
+ "id": 1,
+ "missing": false,
+ "name": "18-29",
+ "numeric_value": 1
},
- "description": "Age category",
- "name": "F_AGECAT"
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "_id": 0,
- "id": 1,
- "name": "18-29",
- "missing": false
- },
- {
- "numeric_value": 2,
- "_id": 1,
- "id": 2,
- "name": "30-49",
- "missing": false
- },
- {
- "numeric_value": 3,
- "_id": 2,
- "id": 3,
- "name": "50-64",
- "missing": false
- },
- {
- "numeric_value": 4,
- "_id": 3,
- "id": 4,
- "name": "65+",
- "missing": false
- },
- {
- "numeric_value": 99,
- "_id": 4,
- "id": 99,
- "name": "Refused",
- "missing": false
- },
- {
- "numeric_value": null,
- "_id": -1,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- },
- {
- "references": {
- "uniform_basis": false,
- "description": null,
- "format": {
- "summary": {
- "digits": 0
- }
+ {
+ "_id": 1,
+ "id": 2,
+ "missing": false,
+ "name": "30-49",
+ "numeric_value": 2
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- }
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
+ {
+ "_id": 2,
+ "id": 3,
+ "missing": false,
+ "name": "50-64",
+ "numeric_value": 3
+ },
+ {
+ "_id": 3,
+ "id": 4,
+ "missing": false,
+ "name": "65+",
+ "numeric_value": 4
+ },
+ {
+ "_id": 4,
+ "id": 99,
+ "missing": false,
+ "name": "Refused",
+ "numeric_value": 99
},
- "name": "Trust"
+ {
+ "_id": -1,
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
},
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- "id": "00000"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- "id": "00002"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- },
- "id": "00001"
- },
- "missing": false
- }
- ],
- "class": "enum"
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": null,
- "name": "Trust",
- "format": {
- "summary": {
- "digits": 0
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00000",
+ "references": {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ }
}
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00002",
+ "references": {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ }
}
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "00000",
- "00002",
- "00001"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "name": "Selected",
- "missing": false
- },
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Other",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00001",
+ "references": {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
}
- ]
- }
- }
- ],
- "missing": 0,
- "measures": {
- "count": {
- "data": [
- 1002.5234324131684,
- 1247.7916049952876,
- 0,
- 765.9507980406985,
- 1484.3642393677555,
- 0,
- 656.4393749723399,
- 1593.8756624361115,
- 0,
- 1520.2348209127326,
- 2573.2276224677926,
- 0,
- 1291.0925791970749,
- 2802.3698641834494,
- 0,
- 1595.4441236462358,
- 2498.0183197342967,
- 0,
- 908.6566750086301,
- 2254.626234708468,
- 0,
- 841.7643918636179,
- 2321.5185178534775,
- 0,
- 1603.7959675490333,
- 1559.4869421680564,
- 0,
- 746.8900823558639,
- 1753.2632224112933,
- 0,
- 721.3824808649454,
- 1778.770823902211,
- 0,
- 1255.8703894419277,
- 1244.2829153252233,
- 0,
- 9.83166357273626,
- 25.955125403512575,
- 0,
- 8.23140252595565,
- 27.555386450293184,
- 0,
- 22.2149559987165,
- 13.571832977532326,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 0,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
}
+ ],
+ "subtype": {
+ "class": "variable"
}
}
},
- "n": 12043,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
},
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ },
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- "filtered": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00000",
+ "00002",
+ "00001"
+ ]
}
- },
- "unfiltered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "filtered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "counts": [
- 711,
- 694,
- 0,
- 564,
- 841,
- 0,
- 362,
- 1043,
- 0,
- 1744,
- 2169,
- 0,
- 1485,
- 2428,
- 0,
- 1286,
- 2627,
- 0,
- 1375,
- 2212,
- 0,
- 1291,
- 2296,
- 0,
- 1487,
- 2100,
- 0,
- 1220,
- 1864,
- 0,
- 1145,
- 1939,
- 0,
- 1308,
- 1776,
- 0,
- 24,
- 30,
- 0,
- 16,
- 38,
- 0,
- 22,
- 32,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 1002.5234324131684,
+ 1247.7916049952876,
+ 0,
+ 765.9507980406985,
+ 1484.3642393677555,
+ 0,
+ 656.4393749723399,
+ 1593.8756624361115,
+ 0,
+ 1520.2348209127326,
+ 2573.2276224677926,
+ 0,
+ 1291.0925791970749,
+ 2802.3698641834494,
+ 0,
+ 1595.4441236462358,
+ 2498.0183197342967,
+ 0,
+ 908.6566750086301,
+ 2254.626234708468,
+ 0,
+ 841.7643918636179,
+ 2321.5185178534775,
+ 0,
+ 1603.7959675490333,
+ 1559.4869421680564,
+ 0,
+ 746.8900823558639,
+ 1753.2632224112933,
+ 0,
+ 721.3824808649454,
+ 1778.770823902211,
+ 0,
+ 1255.8703894419277,
+ 1244.2829153252233,
+ 0,
+ 9.83166357273626,
+ 25.955125403512575,
+ 0,
+ 8.23140252595565,
+ 27.555386450293184,
+ 0,
+ 22.2149559987165,
+ 13.571832977532326,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 0
+ }
+ },
+ "missing": 0,
+ "n": 12043
}
}
\ No newline at end of file
diff --git a/tests/fixtures/cat-hs-x-mr.json b/tests/fixtures/cat-hs-x-mr.json
index ecde45190..f1fcb4a79 100644
--- a/tests/fixtures/cat-hs-x-mr.json
+++ b/tests/fixtures/cat-hs-x-mr.json
@@ -1,620 +1,610 @@
{
- "element": "shoji:view",
- "self": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/cube/?filter=%7B%22filter%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Ffilters%2F2bf229efacc74b4e81a3e5a94657af7e%2F%22%7D&query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F000026%2F%22%7D,%7B%22each%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dc%2F%22%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000dc%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2F230d454e1b5942a99f870fdb0a31c8ca%2Fvariables%2F0000d0%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
- }
- },
- "dimensions": [
+ "query": {
+ "dimensions": [
+ {
+ "variable": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/000026/"
+ },
+ {
+ "each": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dc/"
+ },
+ {
+ "args": [
+ {
+ "variable": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dc/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ },
+ "query_environment": {
+ "filter": [
+ "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/filters/2bf229efacc74b4e81a3e5a94657af7e/"
+ ]
+ },
+ "result": {
+ "counts": [
+ 8,
+ 7,
+ 40,
+ 7,
+ 8,
+ 40,
+ 4,
+ 9,
+ 42,
+ 13,
+ 7,
+ 35,
+ 27,
+ 5,
+ 23,
+ 7,
+ 17,
+ 102,
+ 16,
+ 18,
+ 92,
+ 21,
+ 16,
+ 89,
+ 36,
+ 14,
+ 76,
+ 58,
+ 11,
+ 57,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 6,
+ 51,
+ 253,
+ 26,
+ 49,
+ 235,
+ 39,
+ 42,
+ 229,
+ 130,
+ 29,
+ 151,
+ 134,
+ 33,
+ 143,
+ 5,
+ 64,
+ 332,
+ 27,
+ 59,
+ 315,
+ 54,
+ 57,
+ 290,
+ 190,
+ 31,
+ 180,
+ 166,
+ 42,
+ 193,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 4,
+ 0,
+ 0,
+ 4,
+ 0,
+ 0,
+ 4,
+ 2,
+ 0,
+ 2,
+ 2,
+ 0,
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "pasta",
+ "description": "The geometry of pasta",
+ "name": "Shapes of pasta",
+ "notes": "A categorical variable",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
{
- "variable": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/000026/"
+ "anchor": 2,
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "long pasta"
},
{
- "each": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dc/"
- },
- {
- "function": "as_selected",
- "args": [
- {
- "variable": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000dc/"
- }
- ]
+ "anchor": 6,
+ "args": [
+ 0,
+ 4,
+ 5,
+ 6
+ ],
+ "function": "subtotal",
+ "name": "short pasta"
}
- ],
- "weight": "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/variables/0000d0/"
+ ]
+ }
+ }
},
- "query_environment": {
- "filter": [
- "/api/datasets/230d454e1b5942a99f870fdb0a31c8ca/filters/2bf229efacc74b4e81a3e5a94657af7e/"
- ]
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Bucatini",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Chitarra",
+ "numeric_value": 2
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Boccoli",
+ "numeric_value": 0
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Orecchiette",
+ "numeric_value": 4
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Quadrefiore",
+ "numeric_value": 5
+ },
+ {
+ "id": 6,
+ "missing": false,
+ "name": "Fileja",
+ "numeric_value": 6
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "Skipped",
+ "numeric_value": 32766
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "Not asked",
+ "numeric_value": 32767
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "nordics",
+ "description": "Which of the following Nordic countries have you visited? (select all that apply)",
+ "is_dichotomous": true,
+ "name": "Nordic countries",
+ "notes": "A multiple response variable",
+ "subreferences": [
+ {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ },
+ {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
+ },
+ {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ },
+ {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
+ },
+ {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
+ ],
+ "uniform_basis": false
},
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "pasta",
- "notes": "A categorical variable",
- "view": {
- "show_counts": false,
- "column_width": null,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "long pasta",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 0,
- 4,
- 5,
- 6
- ],
- "name": "short pasta",
- "anchor": 6
- }
- ]
- },
- "include_missing": false,
- "show_numeric_values": false
- },
- "description": "The geometry of pasta",
- "name": "Shapes of pasta"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "Bucatini"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "Chitarra"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Boccoli"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "Orecchiette"
- },
- {
- "numeric_value": 5,
- "missing": false,
- "id": 5,
- "name": "Quadrefiore"
- },
- {
- "numeric_value": 6,
- "missing": false,
- "id": 6,
- "name": "Fileja"
- },
- {
- "numeric_value": 32766,
- "missing": true,
- "id": 32766,
- "name": "Skipped"
- },
- {
- "numeric_value": 32767,
- "missing": true,
- "id": 32767,
- "name": "Not asked"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": "Which of the following Nordic countries have you visited? (select all that apply)",
- "subreferences": [
- {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- }
- ],
- "notes": "A multiple response variable",
- "alias": "nordics",
- "is_dichotomous": true,
- "name": "Nordic countries"
- },
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- "id": "00c0"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- "id": "00c1"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- "id": "00c2"
- },
- "missing": false
- },
- {
- "id": 4,
- "value": {
- "derived": false,
- "references": {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- "id": "00c3"
- },
- "missing": false
- },
- {
- "id": 5,
- "value": {
- "derived": false,
- "references": {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- },
- "id": "00c4"
- },
- "missing": false
- }
- ],
- "class": "enum"
- }
- },
- {
- "references": {
- "uniform_basis": false,
- "description": "Which of the following Nordic countries have you visited? (select all that apply)",
- "subreferences": [
- {
- "alias": "dk",
- "name": "Denmark",
- "description": "milstat_1"
- },
- {
- "alias": "fi",
- "name": "Finland",
- "description": "milstat_2"
- },
- {
- "alias": "is",
- "name": "Iceland",
- "description": "milstat_3"
- },
- {
- "alias": "no",
- "name": "Norway",
- "description": "milstat_4"
- },
- {
- "alias": "se",
- "name": "Sweden",
- "description": "milstat_5"
- }
- ],
- "notes": "A multiple response variable",
- "alias": "nordics",
- "is_dichotomous": true,
- "name": "Nordic countries"
- },
- "derived": true,
- "type": {
- "ordinal": false,
- "subvariables": [
- "00c0",
- "00c1",
- "00c2",
- "00c3",
- "00c4"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c0",
+ "references": {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ }
+ }
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c1",
+ "references": {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
}
- ],
- "missing": 4,
- "measures": {
- "count": {
- "data": [
- 13.9429388352064,
- 7.8457608236017,
- 37.4420619336165,
- 8.98775222464318,
- 6.75088547545906,
- 43.4921238923224,
- 2.82339879190361,
- 9.39810389656636,
- 47.0092589039547,
- 14.0988863511179,
- 6.85411398939268,
- 38.2777612519141,
- 24.1996722313659,
- 6.74355140124564,
- 28.2875379598131,
- 6.09707382055611,
- 26.718686588361,
- 109.24835924782,
- 12.5606144044164,
- 28.2251273511302,
- 101.278377901191,
- 19.5475853813478,
- 21.4339030929137,
- 101.082631182476,
- 43.2918709372284,
- 19.8440855063107,
- 78.9281632131983,
- 73.3217773970914,
- 14.9175541691936,
- 53.8247880904524,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 4.17553624143876,
- 54.6907178153611,
- 254.977373906795,
- 24.8653747443075,
- 52.1215412608349,
- 236.856711958452,
- 51.0432735515856,
- 40.9110163859404,
- 221.889338026069,
- 131.976608396645,
- 33.6954282163294,
- 148.17159135062,
- 129.768419276977,
- 36.053069785047,
- 148.022138901571,
- 7.415972143434,
- 55.4788654934193,
- 306.660319448431,
- 24.3169927551292,
- 53.592299451144,
- 291.645864879011,
- 52.3448557839427,
- 50.2386009854065,
- 266.971700315935,
- 177.521025752456,
- 29.7689365082192,
- 162.265194824609,
- 149.47577168069,
- 37.4519525284223,
- 182.627432876171,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 4.42368570698185,
- 0,
- 0,
- 4.42368570698185,
- 0,
- 0,
- 4.42368570698185,
- 1.35440634933271,
- 0,
- 3.06927935764914,
- 3.06927935764914,
- 0,
- 1.35440634933271,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 4,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ }
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c2",
+ "references": {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ }
+ }
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c3",
+ "references": {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
}
+ }
},
- "element": "crunch:cube",
- "counts": [
- 8,
- 7,
- 40,
- 7,
- 8,
- 40,
- 4,
- 9,
- 42,
- 13,
- 7,
- 35,
- 27,
- 5,
- 23,
- 7,
- 17,
- 102,
- 16,
- 18,
- 92,
- 21,
- 16,
- 89,
- 36,
- 14,
- 76,
- 58,
- 11,
- 57,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 6,
- 51,
- 253,
- 26,
- 49,
- 235,
- 39,
- 42,
- 229,
- 130,
- 29,
- 151,
- 134,
- 33,
- 143,
- 5,
- 64,
- 332,
- 27,
- 59,
- 315,
- 54,
- 57,
- 290,
- 190,
- 31,
- 180,
- 166,
- 42,
- 193,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 4,
- 0,
- 0,
- 4,
- 0,
- 0,
- 4,
- 2,
- 0,
- 2,
- 2,
- 0,
- 2,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n": 896
+ {
+ "id": 5,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00c4",
+ "references": {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
+ }
+ }
+ ],
+ "subtype": {
+ "class": "variable"
+ }
}
- }
-}
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "nordics",
+ "description": "Which of the following Nordic countries have you visited? (select all that apply)",
+ "is_dichotomous": true,
+ "name": "Nordic countries",
+ "notes": "A multiple response variable",
+ "subreferences": [
+ {
+ "alias": "dk",
+ "description": "milstat_1",
+ "name": "Denmark"
+ },
+ {
+ "alias": "fi",
+ "description": "milstat_2",
+ "name": "Finland"
+ },
+ {
+ "alias": "is",
+ "description": "milstat_3",
+ "name": "Iceland"
+ },
+ {
+ "alias": "no",
+ "description": "milstat_4",
+ "name": "Norway"
+ },
+ {
+ "alias": "se",
+ "description": "milstat_5",
+ "name": "Sweden"
+ }
+ ],
+ "uniform_basis": false
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00c0",
+ "00c1",
+ "00c2",
+ "00c3",
+ "00c4"
+ ]
+ }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 13.9429388352064,
+ 7.8457608236017,
+ 37.4420619336165,
+ 8.98775222464318,
+ 6.75088547545906,
+ 43.4921238923224,
+ 2.82339879190361,
+ 9.39810389656636,
+ 47.0092589039547,
+ 14.0988863511179,
+ 6.85411398939268,
+ 38.2777612519141,
+ 24.1996722313659,
+ 6.74355140124564,
+ 28.2875379598131,
+ 6.09707382055611,
+ 26.718686588361,
+ 109.24835924782,
+ 12.5606144044164,
+ 28.2251273511302,
+ 101.278377901191,
+ 19.5475853813478,
+ 21.4339030929137,
+ 101.082631182476,
+ 43.2918709372284,
+ 19.8440855063107,
+ 78.9281632131983,
+ 73.3217773970914,
+ 14.9175541691936,
+ 53.8247880904524,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 4.17553624143876,
+ 54.6907178153611,
+ 254.977373906795,
+ 24.8653747443075,
+ 52.1215412608349,
+ 236.856711958452,
+ 51.0432735515856,
+ 40.9110163859404,
+ 221.889338026069,
+ 131.976608396645,
+ 33.6954282163294,
+ 148.17159135062,
+ 129.768419276977,
+ 36.053069785047,
+ 148.022138901571,
+ 7.415972143434,
+ 55.4788654934193,
+ 306.660319448431,
+ 24.3169927551292,
+ 53.592299451144,
+ 291.645864879011,
+ 52.3448557839427,
+ 50.2386009854065,
+ 266.971700315935,
+ 177.521025752456,
+ 29.7689365082192,
+ 162.265194824609,
+ 149.47577168069,
+ 37.4519525284223,
+ 182.627432876171,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 4.42368570698185,
+ 0,
+ 0,
+ 4.42368570698185,
+ 0,
+ 0,
+ 4.42368570698185,
+ 1.35440634933271,
+ 0,
+ 3.06927935764914,
+ 3.06927935764914,
+ 0,
+ 1.35440634933271,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 4
+ }
+ },
+ "missing": 4,
+ "n": 896
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/cat-subvar-x-mr-augmented.json b/tests/fixtures/cat-subvar-x-mr-augmented.json
index 6ab709d81..580562780 100644
--- a/tests/fixtures/cat-subvar-x-mr-augmented.json
+++ b/tests/fixtures/cat-subvar-x-mr-augmented.json
@@ -1,947 +1,906 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F519304a0c6324316a05d8653575293b2%2Fsubvariables%2F00001%2F%22%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22function%22:%22dimension%22,%22args%22:%5B%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D,%7B%22value%22:%22subvariables%22%7D%5D%7D,%7B%22function%22:%22as_selected%22,%22args%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F13aa1c88f30d4d3d9fbe27349b050f17%2F%22%7D%5D%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Ff6d04137cce547e8acbd46b8d0d66f13%2Fvariables%2F0yADwLRARYg8QMoiERXLx300011d%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/519304a0c6324316a05d8653575293b2/subvariables/00001/"
},
- "dimensions": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/519304a0c6324316a05d8653575293b2/subvariables/00001/"
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "args": [
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ },
+ {
+ "value": "subvariables"
+ }
+ ],
+ "function": "dimension"
+ },
+ {
+ "args": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ }
+ ],
+ "function": "as_selected"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
+ },
+ "result": {
+ "counts": [
+ 4535,
+ 0,
+ 0,
+ 3574,
+ 961,
+ 0,
+ 593,
+ 3942,
+ 0,
+ 0,
+ 5266,
+ 0,
+ 518,
+ 4748,
+ 0,
+ 2706,
+ 2560,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0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
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "KNOWPARTIES_b_W57__1",
+ "name": "Increasing taxes"
},
- {
- "function": "dimension",
- "args": [
+ "type": {
+ "categories": [
{
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
- }
- ]
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
},
{
- "value": "subvariables"
- }
- ]
- },
- {
- "function": "as_selected",
- "args": [
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
}
- ]
- },
- {
- "function": "dimension",
- "args": [
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
+ },
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
{
- "function": "as_selected",
- "args": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
- }
- ]
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
},
{
- "value": "subvariables"
- }
- ]
- },
- {
- "function": "as_selected",
- "args": [
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
{
- "variable": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/13aa1c88f30d4d3d9fbe27349b050f17/"
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
}
- ]
- }
- ],
- "weight": "https://alpha.crunch.io/api/datasets/f6d04137cce547e8acbd46b8d0d66f13/variables/0yADwLRARYg8QMoiERXLx300011d/"
- },
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "KNOWPARTIES_b_W57__1",
- "name": "Increasing taxes"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Other",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "references": {
- "uniform_basis": false,
- "description": null,
- "format": {
- "summary": {
- "digits": 0
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00000",
+ "references": {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ }
}
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00002",
+ "references": {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ }
}
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
},
- "name": "Trust"
- },
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
- },
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- "id": "00000"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- "id": "00002"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- },
- "id": "00001"
- },
- "missing": false
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00001",
+ "references": {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
}
- ],
- "class": "enum"
+ }
+ ],
+ "subtype": {
+ "class": "variable"
}
- },
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": null,
- "name": "Trust",
- "format": {
- "summary": {
- "digits": 0
- }
- },
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- }
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
}
},
- "type": {
- "ordinal": false,
- "subvariables": [
- "00000",
- "00002",
- "00001"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ },
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "references": {
- "uniform_basis": false,
- "description": null,
- "format": {
- "summary": {
- "digits": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- }
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
},
- "name": "Trust"
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00000",
+ "00002",
+ "00001"
+ ]
+ }
+ },
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
},
- "derived": true,
- "type": {
- "subtype": {
- "class": "variable"
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
},
- "elements": [
- {
- "id": 1,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- "id": "00000"
- },
- "missing": false
- },
- {
- "id": 2,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- "id": "00002"
- },
- "missing": false
- },
- {
- "id": 3,
- "value": {
- "derived": false,
- "references": {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
- },
- "id": "00001"
- },
- "missing": false
- }
- ],
- "class": "enum"
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- {
- "derived": true,
- "references": {
- "uniform_basis": false,
- "description": null,
- "name": "Trust",
- "format": {
- "summary": {
- "digits": 0
+ "type": {
+ "class": "enum",
+ "elements": [
+ {
+ "id": 1,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00000",
+ "references": {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ }
}
},
- "subreferences": [
- {
- "alias": "CR_SOURCESUM_NYTimes__1",
- "name": "NYTimes"
- },
- {
- "alias": "CR_SOURCESUM_WashingtonPost__1",
- "name": "WaPo"
- },
- {
- "alias": "CR_SOURCESUM_FoxNews__1",
- "name": "FoxNews"
+ {
+ "id": 2,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00002",
+ "references": {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ }
}
- ],
- "notes": null,
- "api_derivation": null,
- "dichotomous": true,
- "alias": "Trust",
- "view": {
- "show_counts": false,
- "include_noneoftheabove": false,
- "include_missing": false,
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "subvariables": [
- "00000",
- "00002",
- "00001"
- ],
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "selected": true,
- "id": 1,
- "missing": false,
- "name": "Selected"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Other"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "value": {
+ "derived": false,
+ "id": "00001",
+ "references": {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
}
- ]
- }
- }
- ],
- "missing": 0,
- "measures": {
- "count": {
- "data": [
- 3463.892577872864,
- 0,
- 0,
- 2646.7341674907043,
- 817.1584103821615,
- 0,
- 589.8272763930723,
- 2874.0653014797867,
- 0,
- 0,
- 5240.548677632821,
- 0,
- 472.27257430366546,
- 4768.276103329146,
- 0,
- 2655.052324985961,
- 2585.4963526468764,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 2646.7341674907043,
- 472.27257430366546,
- 0,
- 3119.0067417943724,
- 0,
- 0,
- 528.7644489981124,
- 2590.2422927962575,
- 0,
- 817.1584103821615,
- 4768.276103329146,
- 0,
- 0,
- 5585.43451371131,
- 0,
- 2716.1151523809235,
- 2869.319361330401,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 589.8272763930723,
- 2655.052324985961,
- 0,
- 528.7644489981124,
- 2716.1151523809235,
- 0,
- 3244.879601379037,
- 0,
- 0,
- 2874.0653014797867,
- 2585.4963526468764,
- 0,
- 2590.2422927962575,
- 2869.319361330401,
- 0,
- 0,
- 5459.561654126631,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 724.2440963902744,
- 0,
- 0,
- 399.6531812493329,
- 324.59091514094115,
- 0,
- 457.9330031888786,
- 266.31109320139575,
- 0,
- 0,
- 2614.3151323535144,
- 0,
- 109.76172944859509,
- 2504.5534029049213,
- 0,
- 1430.9522070403475,
- 1183.3629253131694,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 399.6531812493329,
- 109.76172944859509,
- 0,
- 509.41491069792835,
- 0,
- 0,
- 330.9453797307386,
- 178.4695309671894,
- 0,
- 324.59091514094115,
- 2504.5534029049213,
- 0,
- 0,
- 2829.1443180458605,
- 0,
- 1557.9398304984857,
- 1271.2044875473734,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 457.9330031888786,
- 1430.9522070403475,
- 0,
- 330.9453797307386,
- 1557.9398304984857,
- 0,
- 1888.8852102292237,
- 0,
- 0,
- 266.31109320139575,
- 1183.3629253131694,
- 0,
- 178.4695309671894,
- 1271.2044875473734,
- 0,
- 0,
- 1449.6740185145632,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 0,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
}
+ ],
+ "subtype": {
+ "class": "variable"
}
}
},
- "n": 12043,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
+ {
+ "derived": true,
+ "references": {
+ "alias": "Trust",
+ "api_derivation": null,
+ "description": null,
+ "dichotomous": true,
+ "format": {
+ "summary": {
+ "digits": 0
+ }
},
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
+ "name": "Trust",
+ "notes": null,
+ "subreferences": [
+ {
+ "alias": "CR_SOURCESUM_NYTimes__1",
+ "name": "NYTimes"
+ },
+ {
+ "alias": "CR_SOURCESUM_WashingtonPost__1",
+ "name": "WaPo"
+ },
+ {
+ "alias": "CR_SOURCESUM_FoxNews__1",
+ "name": "FoxNews"
+ }
+ ],
+ "uniform_basis": false,
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "include_noneoftheabove": false,
+ "show_counts": false
}
},
- "filtered": {
- "unweighted": {
- "selected": 12043,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 12043.000484249482,
- "other": 0,
- "missing": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Selected",
+ "numeric_value": 1,
+ "selected": true
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Other",
+ "numeric_value": 0
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false,
+ "subvariables": [
+ "00000",
+ "00002",
+ "00001"
+ ]
}
- },
- "unfiltered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "filtered": {
- "unweighted_n": 12043,
- "weighted_n": 12043.000484249482
- },
- "counts": [
- 4535,
- 0,
- 0,
- 3574,
- 961,
- 0,
- 593,
- 3942,
- 0,
- 0,
- 5266,
- 0,
- 518,
- 4748,
- 0,
- 2706,
- 2560,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 3574,
- 518,
- 0,
- 4092,
- 0,
- 0,
- 530,
- 3562,
- 0,
- 961,
- 4748,
- 0,
- 0,
- 5709,
- 0,
- 2769,
- 2940,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 593,
- 2706,
- 0,
- 530,
- 2769,
- 0,
- 3299,
- 0,
- 0,
- 3942,
- 2560,
- 0,
- 3562,
- 2940,
- 0,
- 0,
- 6502,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 539,
- 0,
- 0,
- 317,
- 222,
- 0,
- 296,
- 243,
- 0,
- 0,
- 1703,
- 0,
- 92,
- 1611,
- 0,
- 870,
- 833,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 317,
- 92,
- 0,
- 409,
- 0,
- 0,
- 231,
- 178,
- 0,
- 222,
- 1611,
- 0,
- 0,
- 1833,
- 0,
- 935,
- 898,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 296,
- 870,
- 0,
- 231,
- 935,
- 0,
- 1166,
- 0,
- 0,
- 243,
- 833,
- 0,
- 178,
- 898,
- 0,
- 0,
- 1076,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 3463.892577872864,
+ 0,
+ 0,
+ 2646.7341674907043,
+ 817.1584103821615,
+ 0,
+ 589.8272763930723,
+ 2874.0653014797867,
+ 0,
+ 0,
+ 5240.548677632821,
+ 0,
+ 472.27257430366546,
+ 4768.276103329146,
+ 0,
+ 2655.052324985961,
+ 2585.4963526468764,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 2646.7341674907043,
+ 472.27257430366546,
+ 0,
+ 3119.0067417943724,
+ 0,
+ 0,
+ 528.7644489981124,
+ 2590.2422927962575,
+ 0,
+ 817.1584103821615,
+ 4768.276103329146,
+ 0,
+ 0,
+ 5585.43451371131,
+ 0,
+ 2716.1151523809235,
+ 2869.319361330401,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 589.8272763930723,
+ 2655.052324985961,
+ 0,
+ 528.7644489981124,
+ 2716.1151523809235,
+ 0,
+ 3244.879601379037,
+ 0,
+ 0,
+ 2874.0653014797867,
+ 2585.4963526468764,
+ 0,
+ 2590.2422927962575,
+ 2869.319361330401,
+ 0,
+ 0,
+ 5459.561654126631,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 724.2440963902744,
+ 0,
+ 0,
+ 399.6531812493329,
+ 324.59091514094115,
+ 0,
+ 457.9330031888786,
+ 266.31109320139575,
+ 0,
+ 0,
+ 2614.3151323535144,
+ 0,
+ 109.76172944859509,
+ 2504.5534029049213,
+ 0,
+ 1430.9522070403475,
+ 1183.3629253131694,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 399.6531812493329,
+ 109.76172944859509,
+ 0,
+ 509.41491069792835,
+ 0,
+ 0,
+ 330.9453797307386,
+ 178.4695309671894,
+ 0,
+ 324.59091514094115,
+ 2504.5534029049213,
+ 0,
+ 0,
+ 2829.1443180458605,
+ 0,
+ 1557.9398304984857,
+ 1271.2044875473734,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 457.9330031888786,
+ 1430.9522070403475,
+ 0,
+ 330.9453797307386,
+ 1557.9398304984857,
+ 0,
+ 1888.8852102292237,
+ 0,
+ 0,
+ 266.31109320139575,
+ 1183.3629253131694,
+ 0,
+ 178.4695309671894,
+ 1271.2044875473734,
+ 0,
+ 0,
+ 1449.6740185145632,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 0
+ }
+ },
+ "missing": 0,
+ "n": 12043
}
}
\ No newline at end of file
diff --git a/tests/fixtures/cat-x-cat-german-weighted.json b/tests/fixtures/cat-x-cat-german-weighted.json
index befc8c6aa..a1fe4e6d4 100644
--- a/tests/fixtures/cat-x-cat-german-weighted.json
+++ b/tests/fixtures/cat-x-cat-german-weighted.json
@@ -1,230 +1,215 @@
{
- "element": "shoji:view",
- "self": "/api/datasets/123/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22variable%22:%22/api/datasets/123%2Fvariables%2F003588%2F%22%7D,%7B%22variable%22:%22/api/datasets/123%2Fvariables%2F006336%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22/api/datasets/123%2Fvariables%2F001100%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
- }
- },
- "dimensions": [
- {
- "variable": "/api/datasets/123/variables/003588/"
- },
- {
- "variable": "/api/datasets/123/variables/006336/"
- }
- ],
- "weight": "/api/datasets/123/variables/001100/"
+ "query": {
+ "dimensions": [
+ {
+ "variable": "/api/datasets/123/variables/003588/"
+ },
+ {
+ "variable": "/api/datasets/123/variables/006336/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": "/api/datasets/123/variables/001100/"
+ },
+ "result": {
+ "counts": [
+ 3039,
+ 3096,
+ 1718,
+ 793,
+ 652,
+ 2851,
+ 129,
+ 226,
+ 24573,
+ 3450,
+ 3098,
+ 1675,
+ 793,
+ 657,
+ 3409,
+ 145,
+ 236,
+ 21959,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "pdl_gender",
+ "description": "Bitte geben Sie Ihr Geschlecht an.",
+ "name": "Geschlecht",
+ "view": {
+ "roles": [
+ "market_sizing",
+ "group_definition",
+ "profiles_datapoints"
+ ]
+ }
},
- "query_environment": {
- "filter": [
-
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "männlich",
+ "numeric_value": null
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "weiblich",
+ "numeric_value": null
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "pdl_holidays_taken_12_months",
+ "description": "Wie oft waren Sie in den letzten 12 Monaten im Urlaub?
Bitte berücksichtigen Sie hier alle Reisen innerhalb Deutschlands und ins Ausland, bei denen Sie mindestens *einmal übernachtet* haben, allerdings keine Dienstreisen oder Besuche bei Verwandten oder Freunden.",
+ "name": "Urlaub - Anzahl letzte 12 Monate",
+ "view": {
+ "roles": [
+ "market_sizing",
+ "group_definition",
+ "profiles_datapoints"
]
+ }
},
- "result": {
- "dimensions": [
- {
- "derived": false,
- "references": {
- "alias": "pdl_gender",
- "description": "Bitte geben Sie Ihr Geschlecht an.",
- "name": "Geschlecht",
- "view": {
- "roles": [
- "market_sizing",
- "group_definition",
- "profiles_datapoints"
- ]
- }
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "id": 1,
- "name": "männlich",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 2,
- "name": "weiblich",
- "missing": false
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- },
- {
- "derived": false,
- "references": {
- "alias": "pdl_holidays_taken_12_months",
- "description": "Wie oft waren Sie in den letzten 12 Monaten im Urlaub?
Bitte berücksichtigen Sie hier alle Reisen innerhalb Deutschlands und ins Ausland, bei denen Sie mindestens *einmal übernachtet* haben, allerdings keine Dienstreisen oder Besuche bei Verwandten oder Freunden.",
- "name": "Urlaub - Anzahl letzte 12 Monate",
- "view": {
- "roles": [
- "market_sizing",
- "group_definition",
- "profiles_datapoints"
- ]
- }
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "id": 1,
- "name": "ein Mal",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 2,
- "name": "zwei Mal",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 3,
- "name": "drei Mal",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 4,
- "name": "vier Mal",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 5,
- "name": "fünf Mal oder mehr",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 666,
- "name": "kein Mal - ich war in den letzten zwölf Monaten nicht im Urlaub",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 888,
- "name": "weiß nicht",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 777,
- "name": "keine Angabe",
- "missing": false
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 46532,
- "measures": {
- "count": {
- "data": [
- 3702.47166525454,
- 3643.75050423928,
- 1997.62192817279,
- 918.590665092077,
- 771.467154586644,
- 3320.71410531516,
- 166.440540767205,
- 278.104078376692,
- 20391.8539581973,
- 4114.85193945534,
- 3647.97800892696,
- 1924.89008795962,
- 925.519741720192,
- 731.59384577218,
- 4172.16468576896,
- 184.569635535064,
- 281.00640173165,
- 21325.4110531336,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 46532,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "ein Mal",
+ "numeric_value": null
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "zwei Mal",
+ "numeric_value": null
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "drei Mal",
+ "numeric_value": null
},
- "element": "crunch:cube",
- "counts": [
- 3039,
- 3096,
- 1718,
- 793,
- 652,
- 2851,
- 129,
- 226,
- 24573,
- 3450,
- 3098,
- 1675,
- 793,
- 657,
- 3409,
- 145,
- 236,
- 21959,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n": 72499
+ {
+ "id": 4,
+ "missing": false,
+ "name": "vier Mal",
+ "numeric_value": null
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "fünf Mal oder mehr",
+ "numeric_value": null
+ },
+ {
+ "id": 666,
+ "missing": false,
+ "name": "kein Mal - ich war in den letzten zwölf Monaten nicht im Urlaub",
+ "numeric_value": null
+ },
+ {
+ "id": 888,
+ "missing": false,
+ "name": "weiß nicht",
+ "numeric_value": null
+ },
+ {
+ "id": 777,
+ "missing": false,
+ "name": "keine Angabe",
+ "numeric_value": null
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 3702.47166525454,
+ 3643.75050423928,
+ 1997.62192817279,
+ 918.590665092077,
+ 771.467154586644,
+ 3320.71410531516,
+ 166.440540767205,
+ 278.104078376692,
+ 20391.8539581973,
+ 4114.85193945534,
+ 3647.97800892696,
+ 1924.89008795962,
+ 925.519741720192,
+ 731.59384577218,
+ 4172.16468576896,
+ 184.569635535064,
+ 281.00640173165,
+ 21325.4110531336,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 46532
+ }
+ },
+ "missing": 46532,
+ "n": 72499
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/cat-x-cat-hs-2rows-1col.json b/tests/fixtures/cat-x-cat-hs-2rows-1col.json
index 10fd3b22f..989b89482 100644
--- a/tests/fixtures/cat-x-cat-hs-2rows-1col.json
+++ b/tests/fixtures/cat-x-cat-hs-2rows-1col.json
@@ -1,387 +1,346 @@
{
- "element": "shoji:view",
- "self": "https://alpha.crunch.io/api/datasets/d1e8df9e55d44277b7b410a530338e11/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fd1e8df9e55d44277b7b410a530338e11%2Fvariables%2F000067%2F%22%7D,%7B%22variable%22:%22https:%2F%2Falpha.crunch.io%2Fapi%2Fdatasets%2Fd1e8df9e55d44277b7b410a530338e11%2Fvariables%2F000026%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/d1e8df9e55d44277b7b410a530338e11/variables/000067/"
},
- "dimensions": [
- {
- "variable": "https://alpha.crunch.io/api/datasets/d1e8df9e55d44277b7b410a530338e11/variables/000067/"
- },
- {
- "variable": "https://alpha.crunch.io/api/datasets/d1e8df9e55d44277b7b410a530338e11/variables/000026/"
- }
- ],
- "weight": null
+ {
+ "variable": "https://alpha.crunch.io/api/datasets/d1e8df9e55d44277b7b410a530338e11/variables/000026/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
},
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "food_groups",
- "notes": "A categorical variable where the missing categories are interspersed throughout the non-missing categories",
- "description": "Four of the five USDA food groups",
- "name": "Food groups",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 0,
- 2
- ],
- "name": "veg + fruit",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 5,
- 2
- ],
- "name": "grain + fruit",
- "anchor": 5
- }
- ]
- },
- "include_missing": false,
- "column_width": null
+ "weight": null
+ },
+ "result": {
+ "counts": [
+ 32,
+ 33,
+ 158,
+ 66,
+ 93,
+ 49,
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+ 3,
+ 0,
+ 1,
+ 2,
+ 0,
+ 0,
+ 0,
+ 8,
+ 45,
+ 218,
+ 102,
+ 70,
+ 51,
+ 1,
+ 0,
+ 0,
+ 3,
+ 27,
+ 132,
+ 60,
+ 47,
+ 25,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 12,
+ 21,
+ 105,
+ 82,
+ 190,
+ 23,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "food_groups",
+ "description": "Four of the five USDA food groups",
+ "name": "Food groups",
+ "notes": "A categorical variable where the missing categories are interspersed throughout the non-missing categories",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": 2,
+ "args": [
+ 0,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "veg + fruit"
+ },
+ {
+ "anchor": 5,
+ "args": [
+ 5,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "grain + fruit"
+ }
+ ]
}
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Vegetables",
- "missing": false
- },
- {
- "numeric_value": 32766,
- "id": 32766,
- "name": "Don't know",
- "missing": true
- },
- {
- "numeric_value": 2,
- "id": 2,
- "name": "Fruit",
- "missing": false
- },
- {
- "numeric_value": 5,
- "id": 5,
- "name": "Grain",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- },
- {
- "numeric_value": 4,
- "id": 4,
- "name": "Meat",
- "missing": false
- },
- {
- "numeric_value": 32767,
- "id": 32767,
- "name": "Not asked",
- "missing": true
- }
- ]
}
},
- {
- "derived": false,
- "references": {
- "alias": "pasta",
- "notes": "A categorical variable",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 4,
- 5
- ],
- "name": "orecchiette + quad",
- "anchor": 5
- }
- ]
- },
- "include_missing": false,
- "column_width": null
+ "type": {
+ "categories": [
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Vegetables",
+ "numeric_value": 0
},
- "description": "The geometry of pasta",
- "name": "Shapes of pasta"
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "Bucatini"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "Chitarra"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Boccoli"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "Orecchiette"
- },
- {
- "numeric_value": 5,
- "missing": false,
- "id": 5,
- "name": "Quadrefiore"
- },
- {
- "numeric_value": 6,
- "missing": false,
- "id": 6,
- "name": "Fileja"
- },
- {
- "numeric_value": 32766,
- "missing": true,
- "id": 32766,
- "name": "Skipped"
- },
- {
- "numeric_value": 32767,
- "missing": true,
- "id": 32767,
- "name": "Not asked"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 10,
- "measures": {
- "count": {
- "data": [
- 32,
- 33,
- 158,
- 66,
- 93,
- 49,
- 3,
- 0,
- 0,
- 0,
- 0,
- 3,
- 0,
- 1,
- 2,
- 0,
- 0,
- 0,
- 8,
- 45,
- 218,
- 102,
- 70,
- 51,
- 1,
- 0,
- 0,
- 3,
- 27,
- 132,
- 60,
- 47,
- 25,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 12,
- 21,
- 105,
- 82,
- 190,
- 23,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 10,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "Don't know",
+ "numeric_value": 32766
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Fruit",
+ "numeric_value": 2
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Grain",
+ "numeric_value": 5
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Meat",
+ "numeric_value": 4
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "Not asked",
+ "numeric_value": 32767
}
- }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
},
- "n": 1662,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
+ {
+ "derived": false,
+ "references": {
+ "alias": "pasta",
+ "description": "The geometry of pasta",
+ "name": "Shapes of pasta",
+ "notes": "A categorical variable",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": 5,
+ "args": [
+ 4,
+ 5
+ ],
+ "function": "subtotal",
+ "name": "orecchiette + quad"
+ }
+ ]
+ }
}
},
- "filtered": {
- "unweighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Bucatini",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Chitarra",
+ "numeric_value": 2
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Boccoli",
+ "numeric_value": 0
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Orecchiette",
+ "numeric_value": 4
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Quadrefiore",
+ "numeric_value": 5
+ },
+ {
+ "id": 6,
+ "missing": false,
+ "name": "Fileja",
+ "numeric_value": 6
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "Skipped",
+ "numeric_value": 32766
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "Not asked",
+ "numeric_value": 32767
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- },
- "unfiltered": {
- "unweighted_n": 1662,
- "weighted_n": 1662
- },
- "filtered": {
- "unweighted_n": 1662,
- "weighted_n": 1662
- },
- "counts": [
- 32,
- 33,
- 158,
- 66,
- 93,
- 49,
- 3,
- 0,
- 0,
- 0,
- 0,
- 3,
- 0,
- 1,
- 2,
- 0,
- 0,
- 0,
- 8,
- 45,
- 218,
- 102,
- 70,
- 51,
- 1,
- 0,
- 0,
- 3,
- 27,
- 132,
- 60,
- 47,
- 25,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 12,
- 21,
- 105,
- 82,
- 190,
- 23,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 32,
+ 33,
+ 158,
+ 66,
+ 93,
+ 49,
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+ 3,
+ 0,
+ 1,
+ 2,
+ 0,
+ 0,
+ 0,
+ 8,
+ 45,
+ 218,
+ 102,
+ 70,
+ 51,
+ 1,
+ 0,
+ 0,
+ 3,
+ 27,
+ 132,
+ 60,
+ 47,
+ 25,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 12,
+ 21,
+ 105,
+ 82,
+ 190,
+ 23,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 10
+ }
+ },
+ "missing": 10,
+ "n": 1662
}
}
\ No newline at end of file
diff --git a/tests/fixtures/cat-x-cat-hs-total-bottom.json b/tests/fixtures/cat-x-cat-hs-total-bottom.json
index 0e781c049..7202e50ab 100644
--- a/tests/fixtures/cat-x-cat-hs-total-bottom.json
+++ b/tests/fixtures/cat-x-cat-hs-total-bottom.json
@@ -1,397 +1,356 @@
{
- "element": "shoji:view",
- "self": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2F3ffb2ac160d94b159611c32adb87348d%2Fvariables%2F000067%2F%22%7D,%7B%22variable%22:%22https:%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2F3ffb2ac160d94b159611c32adb87348d%2Fvariables%2F000026%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:%22https:%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2F3ffb2ac160d94b159611c32adb87348d%2Fvariables%2F0000d0%2F%22%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/000067/"
},
- "dimensions": [
- {
- "variable": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/000067/"
- },
- {
- "variable": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/000026/"
- }
- ],
- "weight": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/0000d0/"
+ {
+ "variable": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/000026/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
},
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "food_groups",
- "notes": "A categorical variable where the missing categories are interspersed throughout the non-missing categories",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 0,
- 2
- ],
- "name": "veg + fruit",
- "anchor": 2
- },
- {
- "function": "subtotal",
- "args": [
- 4,
- 5
- ],
- "name": "Meat + Grain",
- "anchor": 4
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- },
- "description": "Four of the five USDA food groups",
- "name": "Food groups"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 0,
- "id": 0,
- "name": "Vegetables",
- "missing": false
- },
- {
- "numeric_value": 32766,
- "id": 32766,
- "name": "Don't know",
- "missing": true
- },
- {
- "numeric_value": 2,
- "id": 2,
- "name": "Fruit",
- "missing": false
- },
- {
- "numeric_value": 5,
- "id": 5,
- "name": "Grain",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- },
- {
- "numeric_value": 4,
- "id": 4,
- "name": "Meat",
- "missing": false
- },
- {
- "numeric_value": 32767,
- "id": 32767,
- "name": "Not asked",
- "missing": true
- }
- ]
+ "weight": "https://app.crunch.io/api/datasets/3ffb2ac160d94b159611c32adb87348d/variables/0000d0/"
+ },
+ "result": {
+ "counts": [
+ 32,
+ 33,
+ 158,
+ 66,
+ 93,
+ 49,
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+ 3,
+ 0,
+ 1,
+ 2,
+ 0,
+ 0,
+ 0,
+ 8,
+ 45,
+ 218,
+ 102,
+ 70,
+ 51,
+ 1,
+ 0,
+ 0,
+ 3,
+ 27,
+ 132,
+ 60,
+ 47,
+ 25,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 12,
+ 21,
+ 105,
+ 82,
+ 190,
+ 23,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "food_groups",
+ "description": "Four of the five USDA food groups",
+ "name": "Food groups",
+ "notes": "A categorical variable where the missing categories are interspersed throughout the non-missing categories",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": 2,
+ "args": [
+ 0,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "veg + fruit"
+ },
+ {
+ "anchor": 4,
+ "args": [
+ 4,
+ 5
+ ],
+ "function": "subtotal",
+ "name": "Meat + Grain"
+ }
+ ]
+ }
}
},
- {
- "references": {
- "alias": "pasta",
- "notes": "A categorical variable",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 0,
- 2
- ],
- "name": "chitarra + boccoli",
- "anchor": 0
- },
- {
- "function": "subtotal",
- "args": [
- 32766,
- 6,
- 5
- ],
- "name": "total_test",
- "anchor": 32766
- }
- ]
- },
- "include_missing": false,
- "column_width": null
+ "type": {
+ "categories": [
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Vegetables",
+ "numeric_value": 0
},
- "description": "The geometry of pasta",
- "name": "Shapes of pasta"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "Bucatini"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "Chitarra"
- },
- {
- "numeric_value": 0,
- "missing": false,
- "id": 0,
- "name": "Boccoli"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "Orecchiette"
- },
- {
- "numeric_value": 5,
- "missing": false,
- "id": 5,
- "name": "Quadrefiore"
- },
- {
- "numeric_value": 6,
- "missing": false,
- "id": 6,
- "name": "Fileja"
- },
- {
- "numeric_value": 32766,
- "missing": false,
- "id": 32766,
- "name": "Skipped"
- },
- {
- "numeric_value": 32767,
- "missing": true,
- "id": 32767,
- "name": "Not asked"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 6,
- "measures": {
- "count": {
- "data": [
- 27.846185080981197,
- 26.920661525986212,
- 119.91831256419233,
- 55.51449163731197,
- 81.57047239456325,
- 61.333970868068164,
- 3.671124729035447,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 5.407380731071661,
- 0.0,
- 0.844129024876369,
- 3.688193845495,
- 0.0,
- 0.0,
- 0.0,
- 13.379718875837938,
- 56.383387585584515,
- 193.16744602691415,
- 96.34530049597807,
- 59.34230602464896,
- 66.21849064852807,
- 0.752560977946403,
- 0.0,
- 0.0,
- 4.0124416740416375,
- 32.156209896736364,
- 138.8576652538452,
- 73.05682658220181,
- 38.990044193849364,
- 31.101371133359986,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 13.992415961563905,
- 26.603860648430295,
- 114.90006611707656,
- 88.92700924810279,
- 188.80820544734632,
- 38.2897508064271,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 0.0
- ],
- "n_missing": 6,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": false,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "Don't know",
+ "numeric_value": 32766
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Fruit",
+ "numeric_value": 2
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Grain",
+ "numeric_value": 5
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Meat",
+ "numeric_value": 4
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "Not asked",
+ "numeric_value": 32767
}
- }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
},
- "n": 1662,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1662.0000000000011,
- "other": 0,
- "missing": 0
+ {
+ "derived": false,
+ "references": {
+ "alias": "pasta",
+ "description": "The geometry of pasta",
+ "name": "Shapes of pasta",
+ "notes": "A categorical variable",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": 0,
+ "args": [
+ 0,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "chitarra + boccoli"
+ },
+ {
+ "anchor": 32766,
+ "args": [
+ 32766,
+ 6,
+ 5
+ ],
+ "function": "subtotal",
+ "name": "total_test"
+ }
+ ]
+ }
}
},
- "filtered": {
- "unweighted": {
- "selected": 1662,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1662.0000000000011,
- "other": 0,
- "missing": 0
- }
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Bucatini",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Chitarra",
+ "numeric_value": 2
+ },
+ {
+ "id": 0,
+ "missing": false,
+ "name": "Boccoli",
+ "numeric_value": 0
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Orecchiette",
+ "numeric_value": 4
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Quadrefiore",
+ "numeric_value": 5
+ },
+ {
+ "id": 6,
+ "missing": false,
+ "name": "Fileja",
+ "numeric_value": 6
+ },
+ {
+ "id": 32766,
+ "missing": false,
+ "name": "Skipped",
+ "numeric_value": 32766
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "Not asked",
+ "numeric_value": 32767
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- },
- "unfiltered": {
- "unweighted_n": 1662,
- "weighted_n": 1662.0000000000011
- },
- "filtered": {
- "unweighted_n": 1662,
- "weighted_n": 1662.0000000000011
- },
- "counts": [
- 32,
- 33,
- 158,
- 66,
- 93,
- 49,
- 3,
- 0,
- 0,
- 0,
- 0,
- 3,
- 0,
- 1,
- 2,
- 0,
- 0,
- 0,
- 8,
- 45,
- 218,
- 102,
- 70,
- 51,
- 1,
- 0,
- 0,
- 3,
- 27,
- 132,
- 60,
- 47,
- 25,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 12,
- 21,
- 105,
- 82,
- 190,
- 23,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 27.846185080981197,
+ 26.920661525986212,
+ 119.91831256419233,
+ 55.51449163731197,
+ 81.57047239456325,
+ 61.333970868068164,
+ 3.671124729035447,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 5.407380731071661,
+ 0.0,
+ 0.844129024876369,
+ 3.688193845495,
+ 0.0,
+ 0.0,
+ 0.0,
+ 13.379718875837938,
+ 56.383387585584515,
+ 193.16744602691415,
+ 96.34530049597807,
+ 59.34230602464896,
+ 66.21849064852807,
+ 0.752560977946403,
+ 0.0,
+ 0.0,
+ 4.0124416740416375,
+ 32.156209896736364,
+ 138.8576652538452,
+ 73.05682658220181,
+ 38.990044193849364,
+ 31.101371133359986,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 13.992415961563905,
+ 26.603860648430295,
+ 114.90006611707656,
+ 88.92700924810279,
+ 188.80820544734632,
+ 38.2897508064271,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": false,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 6
+ }
+ },
+ "missing": 6,
+ "n": 1662
}
}
\ No newline at end of file
diff --git a/tests/fixtures/econ-blame-x-ideology-row-and-col-hs.json b/tests/fixtures/econ-blame-x-ideology-row-and-col-hs.json
index 44726b3b0..3a6fc8ddb 100644
--- a/tests/fixtures/econ-blame-x-ideology-row-and-col-hs.json
+++ b/tests/fixtures/econ-blame-x-ideology-row-and-col-hs.json
@@ -1,387 +1,375 @@
{
- "element": "shoji:view",
- "self": "http://local.crunch.io:8080/api/datasets/53434aae61864813abb2a736e3e44ccb/cube/?filter=%5B%5D&query=%7B%22dimensions%22:%5B%7B%22variable%22:%22http:%2F%2Flocal.crunch.io:8080%2Fapi%2Fdatasets%2F53434aae61864813abb2a736e3e44ccb%2Fvariables%2F000000%2F%22%7D,%7B%22variable%22:%22http:%2F%2Flocal.crunch.io:8080%2Fapi%2Fdatasets%2F53434aae61864813abb2a736e3e44ccb%2Fvariables%2F000001%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": [
-
- ]
+ "query": {
+ "dimensions": [
+ {
+ "variable": "http://local.crunch.io:8080/api/datasets/53434aae61864813abb2a736e3e44ccb/variables/000000/"
+ },
+ {
+ "variable": "http://local.crunch.io:8080/api/datasets/53434aae61864813abb2a736e3e44ccb/variables/000001/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": null
+ },
+ "query_environment": {
+ "filter": []
+ },
+ "result": {
+ "counts": [
+ 3,
+ 14,
+ 80,
+ 114,
+ 67,
+ 7,
+ 0,
+ 0,
+ 0,
+ 59,
+ 132,
+ 162,
+ 29,
+ 12,
+ 2,
+ 0,
+ 0,
+ 0,
+ 6,
+ 29,
+ 109,
+ 67,
+ 26,
+ 5,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 1,
+ 1,
+ 0,
+ 2,
+ 0,
+ 0,
+ 0,
+ 3,
+ 6,
+ 23,
+ 7,
+ 5,
+ 24,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "ShutdownBlame",
+ "description": "If President Obama and the Republicans in Congress do not reach a budget agreement in time to avoid a shutdown of the federal government, who do you think will more to blame--President Obama or the Republican Congress?",
+ "name": "ShutdownBlame",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
+ {
+ "anchor": 2,
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "Test New Heading (Obama and Republicans)"
}
+ ]
},
- "dimensions": [
- {
- "variable": "http://local.crunch.io:8080/api/datasets/53434aae61864813abb2a736e3e44ccb/variables/000000/"
- },
+ "transforms": {
+ "insertions": [
{
- "variable": "http://local.crunch.io:8080/api/datasets/53434aae61864813abb2a736e3e44ccb/variables/000001/"
+ "anchor": 1,
+ "args": [
+ 1,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "test new heading"
}
- ],
- "weight": null
- },
- "query_environment": {
- "filter": [
-
- ]
+ ]
+ }
+ }
},
- "result": {
- "dimensions": [
- {
- "derived": false,
- "references": {
- "alias": "ShutdownBlame",
- "description": "If President Obama and the Republicans in Congress do not reach a budget agreement in time to avoid a shutdown of the federal government, who do you think will more to blame--President Obama or the Republican Congress?",
- "name": "ShutdownBlame",
- "view": {
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "name": "Test New Heading (Obama and Republicans)",
- "anchor": 2
- }
- ]
- },
- "include_missing": false,
- "show_counts": false,
- "transforms": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 1,
- 2
- ],
- "anchor": 1,
- "name": "test new heading"
- }
- ]
- },
- "column_width": null
- }
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "President Obama"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "Republicans in Congress"
- },
- {
- "numeric_value": 3,
- "missing": false,
- "id": 3,
- "name": "Both"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "Neither"
- },
- {
- "numeric_value": 5,
- "missing": false,
- "id": 5,
- "name": "Not sure"
- },
- {
- "numeric_value": 8,
- "missing": true,
- "id": 8,
- "name": "Skipped"
- },
- {
- "numeric_value": 9,
- "missing": true,
- "id": 9,
- "name": "Not Asked"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "President Obama",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Republicans in Congress",
+ "numeric_value": 2
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "Both",
+ "numeric_value": 3
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Neither",
+ "numeric_value": 4
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Not sure",
+ "numeric_value": 5
+ },
+ {
+ "id": 8,
+ "missing": true,
+ "name": "Skipped",
+ "numeric_value": 8
+ },
+ {
+ "id": 9,
+ "missing": true,
+ "name": "Not Asked",
+ "numeric_value": 9
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "RespondentIdeology",
+ "description": "In general, how would you describe your own political viewpoint?",
+ "name": "RespondentIdeology",
+ "view": {
+ "column_width": null,
+ "include_missing": false,
+ "show_counts": false,
+ "show_numeric_values": false,
+ "transform": {
+ "insertions": [
{
- "derived": false,
- "references": {
- "alias": "RespondentIdeology",
- "view": {
- "show_counts": false,
- "show_numeric_values": false,
- "transform": {
- "insertions": [
- {
- "function": "subtotal",
- "args": [
- 3,
- 2
- ],
- "name": "Test 2nd dim Heading",
- "anchor": 3
- }
- ]
- },
- "include_missing": false,
- "column_width": null
- },
- "description": "In general, how would you describe your own political viewpoint?",
- "name": "RespondentIdeology"
- },
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 1,
- "missing": false,
- "id": 1,
- "name": "Very liberal"
- },
- {
- "numeric_value": 2,
- "missing": false,
- "id": 2,
- "name": "Liberal"
- },
- {
- "numeric_value": 3,
- "missing": false,
- "id": 3,
- "name": "Moderate"
- },
- {
- "numeric_value": 4,
- "missing": false,
- "id": 4,
- "name": "Conservative"
- },
- {
- "numeric_value": 5,
- "missing": false,
- "id": 5,
- "name": "Very Conservative"
- },
- {
- "numeric_value": 6,
- "missing": false,
- "id": 6,
- "name": "Not sure"
- },
- {
- "numeric_value": 8,
- "missing": true,
- "id": 8,
- "name": "Skipped"
- },
- {
- "numeric_value": 9,
- "missing": true,
- "id": 9,
- "name": "Not Asked"
- },
- {
- "numeric_value": null,
- "missing": true,
- "id": -1,
- "name": "No Data"
- }
- ]
- }
- }
- ],
- "missing": 3,
- "measures": {
- "count": {
- "data": [
- 3,
- 14,
- 80,
- 114,
- 67,
- 7,
- 0,
- 0,
- 0,
- 59,
- 132,
- 162,
- 29,
- 12,
- 2,
- 0,
- 0,
- 0,
- 6,
- 29,
- 109,
- 67,
- 26,
- 5,
- 0,
- 0,
- 0,
- 1,
- 1,
- 1,
- 1,
- 0,
- 2,
- 0,
- 0,
- 0,
- 3,
- 6,
- 23,
- 7,
- 5,
- 24,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 2,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 3,
- "metadata": {
- "references": {
-
- },
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {
-
- },
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
+ "anchor": 3,
+ "args": [
+ 3,
+ 2
+ ],
+ "function": "subtotal",
+ "name": "Test 2nd dim Heading"
}
+ ]
+ }
+ }
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Very liberal",
+ "numeric_value": 1
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "Liberal",
+ "numeric_value": 2
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "Moderate",
+ "numeric_value": 3
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Conservative",
+ "numeric_value": 4
+ },
+ {
+ "id": 5,
+ "missing": false,
+ "name": "Very Conservative",
+ "numeric_value": 5
},
- "element": "crunch:cube",
- "counts": [
- 3,
- 14,
- 80,
- 114,
- 67,
- 7,
- 0,
- 0,
- 0,
- 59,
- 132,
- 162,
- 29,
- 12,
- 2,
- 0,
- 0,
- 0,
- 6,
- 29,
- 109,
- 67,
- 26,
- 5,
- 0,
- 0,
- 0,
- 1,
- 1,
- 1,
- 1,
- 0,
- 2,
- 0,
- 0,
- 0,
- 3,
- 6,
- 23,
- 7,
- 5,
- 24,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 2,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n": 1000
+ {
+ "id": 6,
+ "missing": false,
+ "name": "Not sure",
+ "numeric_value": 6
+ },
+ {
+ "id": 8,
+ "missing": true,
+ "name": "Skipped",
+ "numeric_value": 8
+ },
+ {
+ "id": 9,
+ "missing": true,
+ "name": "Not Asked",
+ "numeric_value": 9
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
}
- }
-}
+ }
+ ],
+ "element": "crunch:cube",
+ "measures": {
+ "count": {
+ "data": [
+ 3,
+ 14,
+ 80,
+ 114,
+ 67,
+ 7,
+ 0,
+ 0,
+ 0,
+ 59,
+ 132,
+ 162,
+ 29,
+ 12,
+ 2,
+ 0,
+ 0,
+ 0,
+ 6,
+ 29,
+ 109,
+ 67,
+ 26,
+ 5,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 1,
+ 1,
+ 0,
+ 2,
+ 0,
+ 0,
+ 0,
+ 3,
+ 6,
+ 23,
+ 7,
+ 5,
+ 24,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 3
+ }
+ },
+ "missing": 3,
+ "n": 1000
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/scale_means/cat-nps-numval-x-cat.json b/tests/fixtures/scale_means/cat-nps-numval-x-cat.json
new file mode 100644
index 000000000..55bbd549d
--- /dev/null
+++ b/tests/fixtures/scale_means/cat-nps-numval-x-cat.json
@@ -0,0 +1,294 @@
+{
+ "query": {
+ "dimensions": [
+ {
+ "variable": "https://app.crunch.io/api/datasets/bc6e2c22a8c14638ae584afaca816311/variables/000020/"
+ },
+ {
+ "variable": "https://app.crunch.io/api/datasets/bc6e2c22a8c14638ae584afaca816311/variables/000029/"
+ }
+ ],
+ "measures": {
+ "count": {
+ "args": [],
+ "function": "cube_count"
+ }
+ },
+ "weight": null
+ },
+ "query_environment": {
+ "filter": []
+ },
+ "result": {
+ "counts": [
+ 42,
+ 103,
+ 120,
+ 33,
+ 0,
+ 0,
+ 0,
+ 122,
+ 237,
+ 453,
+ 266,
+ 0,
+ 0,
+ 0,
+ 14,
+ 33,
+ 29,
+ 6,
+ 0,
+ 0,
+ 0,
+ 7,
+ 16,
+ 3,
+ 1,
+ 0,
+ 0,
+ 0,
+ 4,
+ 6,
+ 1,
+ 4,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "dimensions": [
+ {
+ "derived": false,
+ "references": {
+ "alias": "facebook_apps",
+ "description": "Have you ever downloaded any of the free apps (eg FarmVille, Airport City, etc.) on Facebook?",
+ "name": "facebook_apps"
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Yes",
+ "numeric_value": 100
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "No",
+ "numeric_value": 0
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "Don't remember",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "Prefer not to say",
+ "numeric_value": null
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": 32766
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": 32767
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ },
+ {
+ "derived": false,
+ "references": {
+ "alias": "age4",
+ "description": "Respondent age by category",
+ "name": "age4"
+ },
+ "type": {
+ "categories": [
+ {
+ "id": 1,
+ "missing": false,
+ "name": "Under 30",
+ "numeric_value": null
+ },
+ {
+ "id": 2,
+ "missing": false,
+ "name": "30-44",
+ "numeric_value": null
+ },
+ {
+ "id": 3,
+ "missing": false,
+ "name": "45-64",
+ "numeric_value": null
+ },
+ {
+ "id": 4,
+ "missing": false,
+ "name": "65+",
+ "numeric_value": null
+ },
+ {
+ "id": 32766,
+ "missing": true,
+ "name": "skipped",
+ "numeric_value": null
+ },
+ {
+ "id": 32767,
+ "missing": true,
+ "name": "not asked",
+ "numeric_value": null
+ },
+ {
+ "id": -1,
+ "missing": true,
+ "name": "No Data",
+ "numeric_value": null
+ }
+ ],
+ "class": "categorical",
+ "ordinal": false
+ }
+ }
+ ],
+ "element": "crunch:cube",
+ "filter_stats": {
+ "filtered": {
+ "unweighted": {
+ "missing": 0,
+ "other": 0,
+ "selected": 1500
+ },
+ "weighted": {
+ "missing": 0,
+ "other": 0,
+ "selected": 1500
+ }
+ },
+ "filtered_complete": {
+ "unweighted": {
+ "missing": 0,
+ "other": 0,
+ "selected": 1500
+ },
+ "weighted": {
+ "missing": 0,
+ "other": 0,
+ "selected": 1500
+ }
+ }
+ },
+ "filtered": {
+ "unweighted_n": 1500,
+ "weighted_n": 1500
+ },
+ "measures": {
+ "count": {
+ "data": [
+ 42,
+ 103,
+ 120,
+ 33,
+ 0,
+ 0,
+ 0,
+ 122,
+ 237,
+ 453,
+ 266,
+ 0,
+ 0,
+ 0,
+ 14,
+ 33,
+ 29,
+ 6,
+ 0,
+ 0,
+ 0,
+ 7,
+ 16,
+ 3,
+ 1,
+ 0,
+ 0,
+ 0,
+ 4,
+ 6,
+ 1,
+ 4,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "metadata": {
+ "derived": true,
+ "references": {},
+ "type": {
+ "class": "numeric",
+ "integer": true,
+ "missing_reasons": {
+ "No Data": -1
+ },
+ "missing_rules": {}
+ }
+ },
+ "n_missing": 15
+ }
+ },
+ "missing": 15,
+ "n": 1500,
+ "unfiltered": {
+ "unweighted_n": 1500,
+ "weighted_n": 1500
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/scale_means/facebook-apps-x-age.json b/tests/fixtures/scale_means/facebook-apps-x-age.json
deleted file mode 100644
index ec8350473..000000000
--- a/tests/fixtures/scale_means/facebook-apps-x-age.json
+++ /dev/null
@@ -1,298 +0,0 @@
-{
- "element": "shoji:view",
- "self": "https://app.crunch.io/api/datasets/bc6e2c22a8c14638ae584afaca816311/cube/?query=%7B%22dimensions%22:%5B%7B%22variable%22:%22https:%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2Fbc6e2c22a8c14638ae584afaca816311%2Fvariables%2F000020%2F%22%7D,%7B%22variable%22:%22https:%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2Fbc6e2c22a8c14638ae584afaca816311%2Fvariables%2F000029%2F%22%7D%5D,%22measures%22:%7B%22count%22:%7B%22function%22:%22cube_count%22,%22args%22:%5B%5D%7D%7D,%22weight%22:null%7D",
- "value": {
- "query": {
- "measures": {
- "count": {
- "function": "cube_count",
- "args": []
- }
- },
- "dimensions": [
- {
- "variable": "https://app.crunch.io/api/datasets/bc6e2c22a8c14638ae584afaca816311/variables/000020/"
- },
- {
- "variable": "https://app.crunch.io/api/datasets/bc6e2c22a8c14638ae584afaca816311/variables/000029/"
- }
- ],
- "weight": null
- },
- "query_environment": {
- "filter": []
- },
- "result": {
- "dimensions": [
- {
- "references": {
- "alias": "facebook_apps",
- "name": "facebook_apps",
- "description": "Have you ever downloaded any of the free apps (eg FarmVille, Airport City, etc.) on Facebook?"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": 100,
- "id": 1,
- "name": "Yes",
- "missing": false
- },
- {
- "numeric_value": 0,
- "id": 2,
- "name": "No",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 3,
- "name": "Don't remember",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 4,
- "name": "Prefer not to say",
- "missing": false
- },
- {
- "numeric_value": 32766,
- "id": 32766,
- "name": "skipped",
- "missing": true
- },
- {
- "numeric_value": 32767,
- "id": 32767,
- "name": "not asked",
- "missing": true
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- },
- {
- "references": {
- "alias": "age4",
- "name": "age4",
- "description": "Respondent age by category"
- },
- "derived": false,
- "type": {
- "ordinal": false,
- "class": "categorical",
- "categories": [
- {
- "numeric_value": null,
- "id": 1,
- "name": "Under 30",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 2,
- "name": "30-44",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 3,
- "name": "45-64",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 4,
- "name": "65+",
- "missing": false
- },
- {
- "numeric_value": null,
- "id": 32766,
- "name": "skipped",
- "missing": true
- },
- {
- "numeric_value": null,
- "id": 32767,
- "name": "not asked",
- "missing": true
- },
- {
- "numeric_value": null,
- "id": -1,
- "name": "No Data",
- "missing": true
- }
- ]
- }
- }
- ],
- "missing": 15,
- "measures": {
- "count": {
- "data": [
- 42,
- 103,
- 120,
- 33,
- 0,
- 0,
- 0,
- 122,
- 237,
- 453,
- 266,
- 0,
- 0,
- 0,
- 14,
- 33,
- 29,
- 6,
- 0,
- 0,
- 0,
- 7,
- 16,
- 3,
- 1,
- 0,
- 0,
- 0,
- 4,
- 6,
- 1,
- 4,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "n_missing": 15,
- "metadata": {
- "references": {},
- "derived": true,
- "type": {
- "integer": true,
- "missing_rules": {},
- "missing_reasons": {
- "No Data": -1
- },
- "class": "numeric"
- }
- }
- }
- },
- "n": 1500,
- "filter_stats": {
- "filtered_complete": {
- "unweighted": {
- "selected": 1500,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1500,
- "other": 0,
- "missing": 0
- }
- },
- "filtered": {
- "unweighted": {
- "selected": 1500,
- "other": 0,
- "missing": 0
- },
- "weighted": {
- "selected": 1500,
- "other": 0,
- "missing": 0
- }
- }
- },
- "unfiltered": {
- "unweighted_n": 1500,
- "weighted_n": 1500
- },
- "filtered": {
- "unweighted_n": 1500,
- "weighted_n": 1500
- },
- "counts": [
- 42,
- 103,
- 120,
- 33,
- 0,
- 0,
- 0,
- 122,
- 237,
- 453,
- 266,
- 0,
- 0,
- 0,
- 14,
- 33,
- 29,
- 6,
- 0,
- 0,
- 0,
- 7,
- 16,
- 3,
- 1,
- 0,
- 0,
- 0,
- 4,
- 6,
- 1,
- 4,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "element": "crunch:cube"
- }
- }
-}
\ No newline at end of file
diff --git a/tests/integration/test_pairwise_significance.py b/tests/integration/test_pairwise_significance.py
index 8ea52d455..6ea5a3273 100644
--- a/tests/integration/test_pairwise_significance.py
+++ b/tests/integration/test_pairwise_significance.py
@@ -139,11 +139,46 @@ def it_provides_scale_mean_pairwise_indices_alt(self, fixture, expectation):
class TestStandardizedResiduals(TestCase):
"""Test cr.cube implementation of column family pairwise comparisons"""
- def test_pairwise_measures_scale_means_nps_type(self):
- slice_ = Cube(SM.FACEBOOK_APPS_X_AGE).partitions[0]
- # Testing col 0 with others
- actual = slice_.pairwise_significance_tests[0]
+ def test_ca_subvar_x_cat_hs_pairwise_t_tests(self):
+ slice_ = Cube(CR.CA_SUBVAR_X_CAT_HS).partitions[0]
+ actual = slice_.pairwise_significance_tests[1]
+
+ np.testing.assert_array_almost_equal(
+ actual.t_stats, load_python_expression("ca-subvar-x-cat-hs-pw-tstats")
+ )
+ np.testing.assert_array_almost_equal(
+ actual.p_vals, load_python_expression("ca-subvar-x-cat-hs-pw-pvals")
+ )
+
+ def test_ca_subvar_hs_x_mr_augmented_pairwise_t_tests(self):
+ slice_ = Cube(CR.CA_SUBVAR_HS_X_MR_AUGMENTED).partitions[0]
+ actual = slice_.pairwise_significance_tests[1]
+ overlap_margins = np.sum(slice_._cube.counts, axis=0)[:, 0, :, 0]
+ addend_idxs = [s.addend_idxs for s in slice_._cube.dimensions[0].subtotals]
+ counts_with_hs = counts_with_subtotals(
+ addend_idxs, slice_.inserted_row_idxs, slice_._cube.counts
+ )
+ assert slice_.inserted_row_idxs == (0,)
+ assert slice_.cube_is_mr_aug is True
+ assert actual.t_stats.shape == (3, 4)
+ assert slice_.counts.shape == (3, 4)
+ assert counts_with_hs.shape == (3, 4, 2, 4, 2)
+ np.testing.assert_array_almost_equal(
+ overlap_margins,
+ [[44, 3, 0, 0], [3, 34, 0, 0], [0, 0, 348, 0], [0, 0, 0, 0]],
+ )
+
+ slice_no_aug_ = Cube(CR.CA_SUBVAR_HS_X_MR).partitions[0]
+
+ for i in range(slice_no_aug_.shape[0]):
+ np.testing.assert_array_almost_equal(
+ slice_no_aug_.counts[i], counts_with_hs[i][:, 0, :, 0].diagonal()
+ )
+
+ def test_cat_nps_numval_x_cat_scale_means_pariwise_t_tests(self):
+ slice_ = Cube(SM.CAT_NPS_NUMVAL_X_CAT).partitions[0]
+ actual = slice_.pairwise_significance_tests[0]
assert actual.p_vals_scale_means[0] == 1
assert actual.t_stats_scale_means[0] == 0
np.testing.assert_almost_equal(
@@ -154,9 +189,7 @@ def test_pairwise_measures_scale_means_nps_type(self):
[1.0000000e00, 2.7638510e-01, 2.0302047e-01, 4.0226310e-05],
)
- # Testing col 1 with others
actual = slice_.pairwise_significance_tests[1]
-
assert actual.p_vals_scale_means[1] == 1
assert actual.t_stats_scale_means[1] == 0
np.testing.assert_almost_equal(
@@ -167,7 +200,43 @@ def test_pairwise_measures_scale_means_nps_type(self):
actual.t_stats_scale_means, [-1.08966143, 0.0, -3.19741668, -6.10466696]
)
- def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):
+ def test_cat_x_cat_pairwise_t_tests(self):
+ slice_ = Cube(CR.PAIRWISE_HIROTSU_OCCUPATION_X_ILLNESS).partitions[0]
+ actual = slice_.pairwise_significance_tests[2]
+
+ np.testing.assert_almost_equal(
+ actual.t_stats, load_python_expression("cat-x-cat-pw-tstats")
+ )
+ np.testing.assert_almost_equal(
+ actual.p_vals, load_python_expression("cat-x-cat-pw-pvals")
+ )
+
+ def test_cat_x_cat_hs_pairwise_t_tests(self):
+ slice_ = Cube(CR.PAIRWISE_HIROTSU_ILLNESS_X_OCCUPATION_WITH_HS).partitions[0]
+ t_stats = slice_.pairwise_significance_tests[0].t_stats
+ p_vals = slice_.pairwise_significance_tests[0].p_vals
+
+ np.testing.assert_almost_equal(
+ t_stats, load_python_expression("cat-x-cat-hs-pw-tstats")
+ )
+ np.testing.assert_almost_equal(
+ p_vals, load_python_expression("cat-x-cat-hs-pw-pvals")
+ )
+
+ def test_cat_x_cat_hs_scale_means_pairwise_t_tests(self):
+ slice_ = Cube(CR.PAIRWISE_HIROTSU_ILLNESS_X_OCCUPATION_WITH_HS).partitions[0]
+ actual = slice_.pairwise_significance_tests[0]
+
+ np.testing.assert_almost_equal(
+ actual.t_stats_scale_means,
+ load_python_expression("cat-x-cat-hs-scale-means-pw-tstats"),
+ )
+ np.testing.assert_almost_equal(
+ actual.p_vals_scale_means,
+ load_python_expression("cat-x-cat-hs-scale-means-pw-pvals"),
+ )
+
+ def test_cat_x_cat_pruning_and_hs_scale_means_pairwise_t_tests(self):
transforms = {
"columns_dimension": {"insertions": {}},
"rows_dimension": {"insertions": {}},
@@ -228,178 +297,6 @@ def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):
actual.p_vals_scale_means, [1.0, 0.1046981, 0.059721, 0.2918845]
)
- def test_pairwise_t_stats_scale_means_with_hs(self):
- slice_ = Cube(CR.PAIRWISE_HIROTSU_ILLNESS_X_OCCUPATION_WITH_HS).partitions[0]
- actual = slice_.pairwise_significance_tests[0]
-
- np.testing.assert_almost_equal(
- actual.t_stats_scale_means,
- [
- 0.0,
- -0.70543134,
- -0.06749456,
- -3.59627589,
- -4.15672996,
- -3.26353764,
- -0.30034779,
- -0.8383222,
- -3.02379687,
- -0.85672124,
- -4.26974185,
- ],
- )
-
- np.testing.assert_almost_equal(
- actual.p_vals_scale_means,
- [
- 1.00000000e00,
- 4.80680137e-01,
- 9.46191784e-01,
- 3.31862965e-04,
- 3.31301800e-05,
- 1.10780471e-03,
- 7.63968024e-01,
- 4.02022180e-01,
- 2.52958600e-03,
- 3.91811876e-01,
- 2.03020376e-05,
- ],
- )
-
- def test_ttests_scale_means_use_unweighted_n_for_variance(self):
- slice_ = Cube(CR.CAT_X_CAT_WEIGHTED_TTESTS).partitions[0]
- actual = slice_.pairwise_significance_tests[0]
-
- np.testing.assert_almost_equal(
- actual.t_stats_scale_means, [0.0, -4.38871748, -3.99008596, -5.15679647]
- )
- np.testing.assert_almost_equal(
- actual.p_vals_scale_means,
- [1.0000000e00, 1.3839564e-05, 7.4552516e-05, 4.0145665e-07],
- )
-
- def test_pairwise_t_stats_with_hs(self):
- slice_ = Cube(CR.PAIRWISE_HIROTSU_ILLNESS_X_OCCUPATION_WITH_HS).partitions[0]
- expected = [
- [
- 0.0,
- -0.06178448,
- 0.30342874,
- -3.18865018,
- -3.82130608,
- -2.99560531,
- 0.07456344,
- -0.68932699,
- -2.95469238,
- -0.46970468,
- -4.14956044,
- ],
- [
- 0.0,
- 1.18922394,
- 0.38254102,
- 3.3306654,
- 3.45013209,
- 2.7520633,
- 0.59216241,
- 0.86352416,
- 2.54171145,
- 1.10130414,
- 3.3839919,
- ],
- [
- 0.0,
- -1.7080666,
- -0.931165,
- -0.87419923,
- -0.24915622,
- -0.2367748,
- -0.97198009,
- -0.38504801,
- -0.03910193,
- -1.02720423,
- 0.19773989,
- ],
- ]
- t_stats = slice_.pairwise_significance_tests[0].t_stats
- np.testing.assert_almost_equal(t_stats, expected)
-
- def test_pairwise_p_vals_with_hs(self):
- slice_ = Cube(CR.PAIRWISE_HIROTSU_ILLNESS_X_OCCUPATION_WITH_HS).partitions[0]
- expected = [
- [
- 1.00000000e00,
- 9.50744855e-01,
- 7.61580875e-01,
- 1.45494511e-03,
- 1.35271514e-04,
- 2.75262668e-03,
- 9.40575477e-01,
- 4.90755141e-01,
- 3.16822332e-03,
- 6.38672254e-01,
- 3.44275537e-05,
- ],
- [
- 1.00000000e00,
- 2.34589189e-01,
- 7.02082945e-01,
- 8.84605265e-04,
- 5.67562813e-04,
- 5.94375533e-03,
- 5.53862215e-01,
- 3.88027539e-01,
- 1.11098015e-02,
- 2.71039211e-01,
- 7.25442977e-04,
- ],
- [
- 1.00000000e00,
- 8.78852262e-02,
- 3.51831360e-01,
- 3.82131035e-01,
- 8.03255937e-01,
- 8.12841336e-01,
- 3.31271828e-01,
- 7.00272311e-01,
- 9.68813218e-01,
- 3.04581978e-01,
- 8.43264694e-01,
- ],
- ]
- p_vals = slice_.pairwise_significance_tests[0].p_vals
- np.testing.assert_almost_equal(p_vals, expected)
-
- def test_compare_to_column(self):
- slice_ = Cube(CR.PAIRWISE_HIROTSU_OCCUPATION_X_ILLNESS).partitions[0]
- actual = slice_.pairwise_significance_tests[2]
- expected_tstats = [
- [0.926265419379764, -1.06821799614525, 0],
- [2.46608073666841, 1.45733791450049, 0],
- [4.47444356884568, -0.127565104025694, 0],
- [-0.825615066069789, 1.09455611515513, 0],
- [-3.08993537423754, 0.0491518359221346, 0],
- [1.72556180249472, 0.403257023461294, 0],
- [0.633715242008222, -0.215815666049458, 0],
- [-1.67730697176792, -0.472402692576022, 0],
- [1.17745694642709, 0.663805453182429, 0],
- [-3.74325301090516, -0.723631945942289, 0],
- ]
- expected_pvals = [
- [0.3543704462583741, 0.2854486628456121, 1],
- [0.0137065536277976, 0.1450553643559893, 1],
- [0.0000078991077082, 0.898495781851322, 1],
- [0.4090774528587606, 0.2737382169902576, 1],
- [0.0020173609289613, 0.9607993020139403, 1],
- [0.0845124966799853, 0.6867680056298973, 1],
- [0.5263071263993964, 0.8291359554655602, 1],
- [0.093569693339443, 0.6366499668820378, 1],
- [0.2390913772747494, 0.5068305468138976, 1],
- [0.0001845038553001, 0.4693091017156237, 1],
- ]
- np.testing.assert_almost_equal(actual.t_stats, expected_tstats)
- np.testing.assert_almost_equal(actual.p_vals, expected_pvals)
-
def test_cat_x_cat_summary_pairwise_indices(self):
# Only larger
slice_ = Cube(CR.PAIRWISE_HIROTSU_OCCUPATION_X_ILLNESS).partitions[0]
@@ -416,78 +313,65 @@ def test_cat_x_cat_summary_pairwise_indices(self):
expected_indices = np.array([(1, 2), (0, 2), (0, 1)], dtype="i,i")
np.testing.assert_array_equal(pairwise_indices, expected_indices)
- def test_ttests_use_unweighted_n_for_variance(self):
+ def test_cat_x_cat_wgtd_pairwise_t_tests(self):
"""The weights on this cube demonstrate much higher variance (less
extreme t values, and higher associated p-values) than if weighted_n
were used in the variance estimate of the test statistic.
"""
slice_ = Cube(CR.CAT_X_CAT_WEIGHTED_TTESTS).partitions[0]
actual = slice_.pairwise_significance_tests[0]
- expected_tstats = np.array(
- [
- [0.0, 1.3892930788974391, 0.8869425734660505, 1.402945620973322],
- [0.0, 0.1903540333363253, 0.30894158244285624, 0.3994739596013725],
- [0.0, 0.03761142927757482, 1.2682277741610029, 0.36476016345069556],
- [0.0, -1.187392798652706, -1.0206496663686406, -1.35111583891054],
- [0.0, -1.742783579889951, -2.425391682127969, -3.0738474093706927],
- ]
- ).reshape(5, 4)
- expected_pvals = np.array(
- [
- [1.0, 0.1673820620286901, 0.37579738470724267, 0.16373028998420036],
- [1.0, 0.8493616019040273, 0.7575734897713429, 0.6903959137827367],
- [1.0, 0.9700615941125716, 0.20566822638024163, 0.7160606992310101],
- [1.0, 0.23747780923355655, 0.30821629616167123, 0.17970733830083074],
- [1.0, 0.0839987707197456, 0.015862691173528676, 0.002723927327002773],
- ]
- ).reshape(5, 4)
- np.testing.assert_almost_equal(actual.t_stats, expected_tstats)
- np.testing.assert_almost_equal(actual.p_vals, expected_pvals)
pairwise_indices = slice_.pairwise_indices
- expected_indices = np.array(
- [
- [(), (), (), ()],
- [(), (), (), ()],
- [(), (), (), ()],
- [(), (), (), ()],
- [(2, 3), (), (), ()],
- ],
- dtype=tuple,
+
+ np.testing.assert_almost_equal(
+ actual.t_stats, load_python_expression("cat-x-cat-wgtd-pw-tstats")
+ )
+ np.testing.assert_almost_equal(
+ actual.p_vals, load_python_expression("cat-x-cat-wgtd-pw-pvals")
+ )
+ np.testing.assert_array_equal(
+ pairwise_indices, load_python_expression("cat-x-cat-wgtd-pw-indices")
)
- np.testing.assert_array_equal(pairwise_indices, expected_indices)
- def test_cat_x_mr_weighted_augmented(self):
- """Same behaviour of test_mr_subvar_x_mr_augmented_pairwise_t_test"""
- slice_ = Cube(CR.CAT_X_MR_WEIGHTED_AUGMENTED).partitions[0]
+ def test_cat_x_cat_wgtd_scale_means_pariwise_t_tests(self):
+ slice_ = Cube(CR.CAT_X_CAT_WEIGHTED_TTESTS).partitions[0]
+ actual = slice_.pairwise_significance_tests[0]
+
+ np.testing.assert_almost_equal(
+ actual.t_stats_scale_means, [0.0, -4.38871748, -3.99008596, -5.15679647]
+ )
+ np.testing.assert_almost_equal(
+ actual.p_vals_scale_means,
+ [1.0000000e00, 1.3839564e-05, 7.4552516e-05, 4.0145665e-07],
+ )
+
+ def test_cat_hs_x_mr_wgtd_augmented_pairwise_t_tests(self):
+ slice_ = Cube(CR.CAT_HS_X_MR_AUGMENTED_WGTD).partitions[0]
actual = slice_.pairwise_significance_tests[1]
- overlap_margins = np.sum(slice_._cube.counts, axis=0)[:, 0, :, 0]
- shadow_proportions_tab1 = slice_._cube.counts[0][:, 0, :, 0] / overlap_margins
- shadow_proportions_tab2 = slice_._cube.counts[1][:, 0, :, 0] / overlap_margins
assert slice_.cube_is_mr_aug is True
np.testing.assert_array_almost_equal(
- overlap_margins,
- [
- [4188.13667426, 3046.38734874, 1047.76027958],
- [3046.38734874, 3628.42165249, 859.70982873],
- [1047.76027958, 859.70982873, 5133.76481161],
- ],
+ actual.t_stats, load_python_expression("cat-hs-x-mr-wgtd-aug-pw-tstats")
)
np.testing.assert_array_almost_equal(
- slice_.column_proportions,
- [
- [0.71392963, 0.74796797, 0.55475245],
- [0.28607037, 0.25203203, 0.44524755],
- ],
+ actual.p_vals, load_python_expression("cat-hs-x-mr-wgtd-aug-pw-pvals")
)
+
+ def test_cat_x_mr_weighted_augmented_pairwise_t_tests(self):
+ slice_ = Cube(CR.CAT_X_MR_WEIGHTED_AUGMENTED).partitions[0]
+ actual = slice_.pairwise_significance_tests[1]
+ overlap_margins = np.sum(slice_._cube.counts, axis=0)[:, 0, :, 0]
+ shadow_proportions_tab1 = slice_._cube.counts[0][:, 0, :, 0] / overlap_margins
+ shadow_proportions_tab2 = slice_._cube.counts[1][:, 0, :, 0] / overlap_margins
+
+ assert slice_.cube_is_mr_aug is True
+ # --- each diagonal of the shadow proportions tab is equal to the correspondent
+ # --- row for the actual proportions
np.testing.assert_array_almost_equal(
shadow_proportions_tab1.diagonal(), slice_.column_proportions[0, :]
)
np.testing.assert_array_almost_equal(
shadow_proportions_tab2.diagonal(), slice_.column_proportions[1, :]
)
- # each diagonal of the shadow proportions tab is equal to the correspondent row
- # for the actual proportions
np.testing.assert_array_almost_equal(
actual.t_stats,
[[-10.2964264, 0.0, -20.09577285], [5.96350953, 0.0, 24.14335882]],
@@ -496,124 +380,20 @@ def test_cat_x_mr_weighted_augmented(self):
actual.p_vals,
[[0.0, 1.00000000e00, 0.0], [2.55612775e-09, 1.00000000e00, 0.0]],
)
- assert slice_._cube.counts.shape == (2, 3, 2, 3, 2)
- assert actual.t_stats.shape == (2, 3)
- def test_ca_subvar_hs_x_mr_augmented(self):
- slice_ = Cube(CR.CA_SUBVAR_HS_X_MR_AUGMENTED).partitions[0]
- actual = slice_.pairwise_significance_tests[1]
- overlap_margins = np.sum(slice_._cube.counts, axis=0)[:, 0, :, 0]
- addend_idxs = [s.addend_idxs for s in slice_._cube.dimensions[0].subtotals]
- counts_with_hs = counts_with_subtotals(
- addend_idxs, slice_.inserted_row_idxs, slice_._cube.counts
- )
- assert slice_.inserted_row_idxs == (0,)
- assert slice_.cube_is_mr_aug is True
- assert actual.t_stats.shape == (3, 4)
- assert slice_.counts.shape == (3, 4)
- assert counts_with_hs.shape == (3, 4, 2, 4, 2)
- np.testing.assert_array_almost_equal(
- overlap_margins,
- [[44, 3, 0, 0], [3, 34, 0, 0], [0, 0, 348, 0], [0, 0, 0, 0]],
- )
-
- slice_no_aug_ = Cube(CR.CA_SUBVAR_HS_X_MR).partitions[0]
-
- for i in range(slice_no_aug_.shape[0]):
- np.testing.assert_array_almost_equal(
- slice_no_aug_.counts[i], counts_with_hs[i][:, 0, :, 0].diagonal()
- )
-
- def test_cat_hs_x_mr_augmented_wgtd(self):
- slice_ = Cube(CR.CAT_HS_X_MR_AUGMENTED_WGTD).partitions[0]
+ def test_mr_x_mr_pairwise_t_tests(self):
+ slice_ = Cube(CR.MR_X_MR_2).partitions[0]
actual = slice_.pairwise_significance_tests[1]
- overlap_margins = np.sum(slice_._cube.counts, axis=0)[:, 0, :, 0]
- addend_idxs = [s.addend_idxs for s in slice_._cube.dimensions[0].subtotals]
- counts_with_hs = counts_with_subtotals(
- addend_idxs, slice_.inserted_row_idxs, slice_._cube.counts
- )
- # CATxMR (9, 3, 2, 3, 2) shape, 9 = (5 + 4subtot) tabs of shadow proportions
- assert slice_.inserted_row_idxs == (0, 1, 4, 8)
- assert slice_.cube_is_mr_aug is True
- assert actual.t_stats.shape == (9, 3)
- assert slice_.counts.shape == (9, 3)
- np.testing.assert_array_almost_equal(
- overlap_margins,
- np.array(
- [
- [4188.13667426, 3046.38734874, 1047.76027958],
- [3046.38734874, 3628.42165249, 859.70982873],
- [1047.76027958, 859.70982873, 5133.76481161],
- ]
- ),
- )
- np.testing.assert_array_almost_equal(
- actual.t_stats,
- np.array(
- [
- [6.11927895, 0.0, -14.1303337],
- [-7.69445366, 0.0, 12.49573404],
- [5.69285527, 0.0, -11.74466913],
- [1.38057613, 0.0, -5.07435061],
- [-1.53449069, 0.0, 3.79025526],
- [-3.55908594, 0.0, 9.3099453],
- [-5.57805647, 0.0, 5.41192963],
- [0.22264108, 0.0, 1.98230386],
- [-5.55112327, 0.0, 5.63360373],
- ]
- ),
- )
+ assert slice_.cube_is_mr_aug is False
np.testing.assert_array_almost_equal(
- actual.p_vals,
- np.array(
- [
- [9.76839276e-10, 1.00000000e00, 0.00000000e00],
- [1.55431223e-14, 1.00000000e00, 0.00000000e00],
- [1.28612265e-08, 1.00000000e00, 0.00000000e00],
- [1.67441552e-01, 1.00000000e00, 3.96622408e-07],
- [1.24942021e-01, 1.00000000e00, 1.51478682e-04],
- [3.73949987e-04, 1.00000000e00, 0.00000000e00],
- [2.49833210e-08, 1.00000000e00, 6.39580235e-08],
- [8.23819611e-01, 1.00000000e00, 4.74757203e-02],
- [2.91411313e-08, 1.00000000e00, 1.81814095e-08],
- ]
- ),
+ actual.t_stats, load_python_expression("mr-x-mr-pw-tstats")
)
- actual = slice_.pairwise_significance_tests[1]
-
- slice_no_hs_ = Cube(CR.CAT_X_MR_AUGMENTED).partitions[0]
- actual_no_hs = slice_no_hs_.pairwise_significance_tests[1]
-
- # Same fixture without insertion has 5,3 shape with same values for t_stats
- # not considering the insertions in the fixture above
np.testing.assert_array_almost_equal(
- actual_no_hs.t_stats,
- np.array(
- [
- [5.69285527, 0.0, -11.74466913],
- [1.38057613, 0.0, -5.07435061],
- [-3.55908594, 0.0, 9.3099453],
- [-5.57805647, 0.0, 5.41192963],
- [0.22264108, 0.0, 1.98230386],
- ]
- ),
+ actual.p_vals, load_python_expression("mr-x-mr-pw-pvals")
)
- np.testing.assert_array_almost_equal(actual_no_hs.t_stats[0], actual.t_stats[2])
- np.testing.assert_array_almost_equal(actual_no_hs.t_stats[1], actual.t_stats[3])
- np.testing.assert_array_almost_equal(actual_no_hs.t_stats[2], actual.t_stats[5])
- np.testing.assert_array_almost_equal(actual_no_hs.t_stats[3], actual.t_stats[6])
- np.testing.assert_array_almost_equal(actual_no_hs.t_stats[4], actual.t_stats[7])
-
- slice_no_aug_ = Cube(CR.CAT_HS_X_MR_WGTD).partitions[0]
- np.testing.assert_array_almost_equal(slice_.counts, slice_no_aug_.counts)
- for i in range(slice_no_aug_.shape[0]):
- np.testing.assert_array_almost_equal(
- slice_no_aug_.counts[i], counts_with_hs[i][:, 0, :, 0].diagonal()
- )
-
- def test_mr_x_mr_weighted_augmented_pairwise_t_test(self):
+ def test_mr_x_mr_weighted_augmented_pairwise_t_tests(self):
"""This test proofs the hypotesis testing for MR1_X_MR2 considering the
overlaps. To calculate the overlap of this kind of cube we need to calculate
the shadow proportion behind the MR1_X_MR2 table:
@@ -681,34 +461,10 @@ def test_mr_x_mr_weighted_augmented_pairwise_t_test(self):
assert slice_.cube_is_mr_aug is True
np.testing.assert_array_almost_equal(
- actual.t_stats,
- [
- [-10.2964264, 0.0, -20.09577285],
- [-16.38251357, 0.0, -28.57841019],
- [-7.42875194, 0.0, 2.33766663],
- [-10.88338158, 0.0, -22.45002834],
- [-2.12632668, 0.0, -11.07466431],
- ],
- )
- np.testing.assert_array_almost_equal(
- actual.p_vals,
- [
- [0.0, 1.00000000e00, 0.0],
- [0.0, 1.00000000e00, 0.0],
- [1.19015908e-13, 1.00000000e00, 1.94264286e-02],
- [0.0, 1.00000000e00, 0.0],
- [3.35015757e-02, 1.00000000e00, 0.0],
- ],
+ actual.t_stats, load_python_expression("mr-x-mr-wgtd-aug-pw-tstats")
)
np.testing.assert_array_almost_equal(
- slice_.column_proportions,
- [
- [0.71392963, 0.74796797, 0.55475245],
- [0.67749583, 0.72581913, 0.44912163],
- [0.62702902, 0.6603541, 0.68236206],
- [0.80466553, 0.8360987, 0.64524993],
- [0.43519965, 0.44556699, 0.33807508],
- ],
+ actual.p_vals, load_python_expression("mr-x-mr-wgtd-aug-pw-pvals")
)
# each diagonal of the shadow proportions tab is equal to the correspondent row
# for the actual proportions
@@ -730,7 +486,7 @@ def test_mr_x_mr_weighted_augmented_pairwise_t_test(self):
assert slice_._cube.counts.shape == (5, 2, 3, 2, 3, 2)
assert actual.t_stats.shape == (5, 3)
- def test_mr_subvar_x_mr_augmented_pairwise_t_test(self):
+ def test_mr_subvar_x_mr_augmented_pairwise_t_tests(self):
"""This test proofs the hypotesis testing for MR_SUBVAR_X_MR considering the
overlaps. To calculate the overlap of this kind of cube we need to calculate
the shadow proportion behind the SUBVAR_X_MR table:
@@ -790,38 +546,18 @@ def test_mr_subvar_x_mr_augmented_pairwise_t_test(self):
assert slice_.cube_is_mr_aug is True
np.testing.assert_array_almost_equal(
- actual.t_stats,
- [[0.0, 16.02651373, -22.43766743], [0.0, -6.56624439, 29.71952066]],
- )
- np.testing.assert_array_almost_equal(
- actual.p_vals,
- [
- [1.00000000e00, 0.00000000e00, 0.00000000e00],
- [1.00000000e00, 5.42792478e-11, 0.00000000e00],
- ],
+ actual.t_stats, load_python_expression("mr-subvar-x-mr-aug-pw-tstats")
)
np.testing.assert_array_almost_equal(
- slice_.column_proportions,
- [
- [0.82707248, 0.85960427, 0.63206628],
- [0.17292752, 0.14039573, 0.36793372],
- ],
+ actual.p_vals, load_python_expression("mr-subvar-x-mr-aug-pw-pvals")
)
np.testing.assert_array_almost_equal(
shadow_proportions_tab1,
- [
- [0.82707248, 0.86881078, 0.56294105],
- [0.86881078, 0.85960427, 0.61504991],
- [0.56294105, 0.61504991, 0.63206628],
- ],
+ load_python_expression("mr-subvar-x-mr-aug-pw-shadow-proportions-tab1"),
)
np.testing.assert_array_almost_equal(
shadow_proportions_tab2,
- [
- [0.17292752, 0.13118922, 0.43705895],
- [0.13118922, 0.14039573, 0.38495009],
- [0.43705895, 0.38495009, 0.36793372],
- ],
+ load_python_expression("mr-subvar-x-mr-aug-pw-shadow-proportions-tab2"),
)
np.testing.assert_array_almost_equal(
shadow_proportions_tab1.diagonal(), slice_.column_proportions[0, :]
@@ -829,29 +565,3 @@ def test_mr_subvar_x_mr_augmented_pairwise_t_test(self):
np.testing.assert_array_almost_equal(
shadow_proportions_tab2.diagonal(), slice_.column_proportions[1, :]
)
-
- def test_mr_x_mr_pairwise_t_test(self):
- slice_ = Cube(CR.MR_X_MR_2).partitions[0]
- actual = slice_.pairwise_significance_tests[1]
-
- assert slice_.cube_is_mr_aug is False
- np.testing.assert_array_almost_equal(
- actual.t_stats,
- [
- [-0.80066287, 0.0, -2.22179624],
- [-0.60726974, 0.0, -2.1554303],
- [1.203117, 0.0, 0.14490412],
- [1.59774062, 0.0, 0.43050695],
- [-1.71054946, 0.0, 1.53817055],
- ],
- )
- np.testing.assert_array_almost_equal(
- actual.p_vals,
- [
- [0.42416402, 1.0, 0.02645888],
- [0.54427888, 1.0, 0.03130077],
- [0.23018433, 1.0, 0.88480775],
- [0.11149176, 1.0, 0.66689419],
- [0.08853052, 1.0, 0.12423633],
- ],
- )
diff --git a/tests/integration/test_scale_means.py b/tests/integration/test_scale_means.py
index bd5b0126f..c1e274361 100644
--- a/tests/integration/test_scale_means.py
+++ b/tests/integration/test_scale_means.py
@@ -23,6 +23,28 @@ def test_ca_items_x_cat():
assert slice_.scale_means_rows_margin is None
+def test_ca_itmes_x_cat_var_scale_means():
+ # These 2 fixtures represent 1 dataset and its transpose version
+ slice_ = Cube(SM.CA_ITEMS_X_CAT).partitions[0]
+ slice2_ = Cube(SM.CA_CAT_X_ITEMS).partitions[0]
+
+ # Testing that the scale means (row and col) are equal on the 2 diverse
+ # datasets
+ np.testing.assert_array_almost_equal(
+ slice_.var_scale_means_column, slice2_.var_scale_means_row
+ )
+
+ np.testing.assert_array_almost_equal(
+ slice2_.var_scale_means_row, [2.56410909, 5.17893869, 4.75445248, 4.81611278]
+ )
+ np.testing.assert_array_almost_equal(
+ slice_.var_scale_means_column, [2.56410909, 5.17893869, 4.75445248, 4.81611278]
+ )
+
+ assert slice2_.var_scale_means_column is None
+ assert slice_.var_scale_means_row is None
+
+
def test_ca_x_mr():
slice_ = Cube(SM.CA_X_MR).partitions[0]
np.testing.assert_almost_equal(
@@ -99,6 +121,30 @@ def test_cat_x_cat():
assert slice_.scale_means_rows_margin == 2.6846246973365617
+def test_cat_hs_x_cat_hs_var_scale_means():
+ slice_ = Cube(CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS).partitions[0]
+
+ assert slice_.var_scale_means_column is not None
+ assert slice_.var_scale_means_row is not None
+
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_column,
+ [0.88930748, 0.93655622, 1.36425875, 0.96388566, 3.55555556, 2.55601211],
+ )
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row,
+ [
+ 0.51774691,
+ 0.51796281,
+ 0.99555556,
+ 0.84071826,
+ 1.12549449,
+ 1.19867769,
+ 2.4775,
+ ],
+ )
+
+
def test_cat_x_mr():
slice_ = Cube(SM.CAT_X_MR).partitions[0]
np.testing.assert_almost_equal(
@@ -110,34 +156,6 @@ def test_cat_x_mr():
assert slice_.scale_means_rows_margin == 2.5323565323565322
-def test_mr_x_cat():
- slice_ = Cube(SM.MR_X_CAT).partitions[0]
- assert slice_.scale_means_row is None
- np.testing.assert_almost_equal(
- slice_.scale_means_column, [2.45070423, 2.54471545, 2.54263006, np.nan]
- )
-
- assert slice_.scale_means_columns_margin == 2.5323565323565322
- assert slice_.scale_means_rows_margin is None
-
-
-def test_univariate_cat():
- strand = Cube(SM.UNIVARIATE_CAT).partitions[0]
- np.testing.assert_almost_equal(strand.scale_mean, [2.6865854])
-
-
-def test_univariate_cat_with_hiding():
- strand_ = Cube(SM.BOLSHEVIK_HAIR).partitions[0]
- np.testing.assert_almost_equal(strand_.scale_mean, [1.504548211])
-
- # Appling hiding transforms
- transforms = {
- "rows_dimension": {"elements": {"5": {"hide": True}, "4": {"hide": True}}}
- }
- strand_with_hiding_ = Cube(SM.BOLSHEVIK_HAIR, transforms=transforms).partitions[0]
- np.testing.assert_almost_equal(strand_.scale_mean, strand_with_hiding_.scale_mean)
-
-
def test_cat_x_cat_with_hs():
# Test without H&S
transforms = {
@@ -166,50 +184,6 @@ def test_cat_x_cat_with_hs():
)
-def test_univariate_with_hs():
- # Test without H&S
- transforms = {
- "columns_dimension": {"insertions": {}},
- "rows_dimension": {"insertions": {}},
- }
- strand = Cube(CR.ECON_BLAME_WITH_HS, transforms).partitions[0]
- np.testing.assert_almost_equal(strand.scale_mean, [2.17352056])
-
- # Test with H&S
- strand = Cube(CR.ECON_BLAME_WITH_HS).partitions[0]
- np.testing.assert_almost_equal(strand.scale_mean, [2.17352056])
-
-
-def test_cat_x_cat_with_hs_on_both_dims():
- # Test without H&S
- transforms = {
- "columns_dimension": {"insertions": {}},
- "rows_dimension": {"insertions": {}},
- }
- slice_ = Cube(
- CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS, transforms=transforms
- ).partitions[0]
- np.testing.assert_almost_equal(
- slice_.scale_means_row,
- [2.19444444, 2.19230769, 2.26666667, 1.88990826, 1.76363636, 3.85],
- )
- np.testing.assert_almost_equal(
- slice_.scale_means_column,
- [3.87368421, 2.51767677, 3.38429752, 3.66666667, 4.13235294],
- )
-
- # Test with H&S
- slice_ = Cube(CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS).partitions[0]
- np.testing.assert_almost_equal(
- slice_.scale_means_row,
- [2.19444444, 2.19230769, 2.26666667, 2.2423698, 1.88990826, 1.76363636, 3.85],
- )
- np.testing.assert_almost_equal(
- slice_.scale_means_column,
- [3.87368421, 2.51767677, 3.0851689, 3.38429752, 3.66666667, 4.13235294],
- )
-
-
def test_ca_x_mr_with_hs_and_pruning():
transforms = {
"columns_dimension": {"insertions": {}},
@@ -310,6 +284,85 @@ def test_cat_x_cat_scale_means_margin():
assert slice_.scale_means_columns_margin == 2.536319612590799
+def test_cat_x_ca_subvar_scale_means():
+ slice_ = Cube(CR.FRUIT_X_PETS_ARRAY_SUBVARS_FIRST).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row, [0.2054321, 0.24, 0.22558594]
+ )
+ assert slice_.var_scale_means_column is None
+
+ slice_ = Cube(CR.FRUIT_X_PETS_ARRAY_SUBVARS_FIRST).partitions[1]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row, [0.2283737, 0.21, 0.21606648]
+ )
+ assert slice_.scale_means_column is None
+
+
+def test_cat_x_cat_pruning_and_hs_var_scale_means():
+ transforms = {
+ "columns_dimension": {"insertions": {}},
+ "rows_dimension": {"insertions": {}},
+ }
+ slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row,
+ [1.4459092, 2.14619102, 2.40430987, np.nan, 0.87972883],
+ )
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_column,
+ [0.72358198, 0.9991, 1.87633763, 0.4859843, np.nan, 0.66666667],
+ )
+
+ # Just H&S
+ slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row,
+ [1.4459092, 1.8494177, 2.14619102, 2.40430987, np.nan, 0.87972883],
+ ),
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_column,
+ [0.72358198, 1.08423566, 0.9991, 1.87633763, 0.4859843, np.nan, 0.66666667],
+ )
+
+ # Just pruning
+ transforms = {
+ "rows_dimension": {"prune": True},
+ "columns_dimension": {"prune": True},
+ }
+ slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row,
+ [1.4459092, 1.8494177, 2.14619102, 2.40430987, 0.87972883],
+ )
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_column,
+ [0.72358198, 1.08423566, 0.9991, 1.87633763, 0.4859843, 0.66666667],
+ )
+
+ # Pruning and H&S
+ transforms = {
+ "rows_dimension": {"insertions": {}, "prune": True},
+ "columns_dimension": {"insertions": {}, "prune": True},
+ }
+ slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row, [1.4459092, 2.14619102, 2.40430987, 0.87972883]
+ ),
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_column,
+ [0.72358198, 0.9991, 1.87633763, 0.4859843, 0.66666667],
+ )
+
+
+def test_cat_nps_numval_x_cat_var_scale_means():
+ slice_ = Cube(SM.CAT_NPS_NUMVAL_X_CAT).partitions[0]
+ np.testing.assert_almost_equal(
+ slice_.var_scale_means_row,
+ [1905.11600238, 2111.67820069, 1655.65636907, 981.86821176],
+ )
+ assert slice_.var_scale_means_column is None
+
+
def test_cat_single_element_x_cat():
slice_ = Cube(SM.CAT_SINGLE_ELEMENT_X_CAT).partitions[0]
np.testing.assert_equal(slice_.scale_means_row, [np.nan, np.nan, np.nan, np.nan])
@@ -406,7 +459,7 @@ def test_means_with_null_values():
assert slice_.scale_means_column is None
-def test_var_scale_mean_univariate_cat():
+def test_mean_univariate_cat_var_scale_mean():
# Test nonmissing with no null numeric values
strand_ = Cube(SM.UNIVARIATE_CAT).partitions[0]
is_a_number_mask = ~np.isnan(strand_._numeric_values)
@@ -436,26 +489,15 @@ def test_var_scale_mean_univariate_cat():
np.testing.assert_array_equal(strand_._counts_as_array[is_a_number_mask], [])
-def test_var_scale_means_for_ca_itmes_x_cat():
- # These 2 fixtures represent 1 dataset and its transpose version
- slice_ = Cube(SM.CA_ITEMS_X_CAT).partitions[0]
- slice2_ = Cube(SM.CA_CAT_X_ITEMS).partitions[0]
-
- # Testing that the scale means (row and col) are equal on the 2 diverse
- # datasets
- np.testing.assert_array_almost_equal(
- slice_.var_scale_means_column, slice2_.var_scale_means_row
- )
-
- np.testing.assert_array_almost_equal(
- slice2_.var_scale_means_row, [2.56410909, 5.17893869, 4.75445248, 4.81611278]
- )
- np.testing.assert_array_almost_equal(
- slice_.var_scale_means_column, [2.56410909, 5.17893869, 4.75445248, 4.81611278]
+def test_mr_x_cat():
+ slice_ = Cube(SM.MR_X_CAT).partitions[0]
+ assert slice_.scale_means_row is None
+ np.testing.assert_almost_equal(
+ slice_.scale_means_column, [2.45070423, 2.54471545, 2.54263006, np.nan]
)
- assert slice2_.var_scale_means_column is None
- assert slice_.var_scale_means_row is None
+ assert slice_.scale_means_columns_margin == 2.5323565323565322
+ assert slice_.scale_means_rows_margin is None
def test_var_scale_means_for_fruit_x_pets_array():
@@ -473,69 +515,38 @@ def test_var_scale_means_for_fruit_x_pets_array():
)
-def test_var_scale_means_for_econ_blame_x_ideology_row_and_col_hs():
- slice_ = Cube(CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS).partitions[0]
+def test_univariate_cat():
+ strand = Cube(SM.UNIVARIATE_CAT).partitions[0]
+ np.testing.assert_almost_equal(strand.scale_mean, [2.6865854])
- assert slice_.var_scale_means_column is not None
- assert slice_.var_scale_means_row is not None
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.88930748, 0.93655622, 1.36425875, 0.96388566, 3.55555556, 2.55601211],
- )
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [
- 0.51774691,
- 0.51796281,
- 0.99555556,
- 0.84071826,
- 1.12549449,
- 1.19867769,
- 2.4775,
- ],
- )
+def test_univariate_cat_with_hiding():
+ strand_ = Cube(SM.BOLSHEVIK_HAIR).partitions[0]
+ np.testing.assert_almost_equal(strand_.scale_mean, [1.504548211])
+ # Appling hiding transforms
+ transforms = {
+ "rows_dimension": {"elements": {"5": {"hide": True}, "4": {"hide": True}}}
+ }
+ strand_with_hiding_ = Cube(SM.BOLSHEVIK_HAIR, transforms=transforms).partitions[0]
+ np.testing.assert_almost_equal(strand_.scale_mean, strand_with_hiding_.scale_mean)
-def test_var_scale_means_cat_x_cat_with_hs_on_both_dims():
+
+def test_univariate_with_hs():
# Test without H&S
transforms = {
"columns_dimension": {"insertions": {}},
"rows_dimension": {"insertions": {}},
}
- slice_ = Cube(
- CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS, transforms=transforms
- ).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [0.51774691, 0.51796281, 0.99555556, 1.12549449, 1.19867769, 2.4775],
- )
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.88930748, 0.93655622, 0.96388566, 3.55555556, 2.55601211],
- )
+ strand = Cube(CR.ECON_BLAME_WITH_HS, transforms).partitions[0]
+ np.testing.assert_almost_equal(strand.scale_mean, [2.17352056])
# Test with H&S
- slice_ = Cube(CR.ECON_BLAME_X_IDEOLOGY_ROW_AND_COL_HS).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [
- 0.51774691,
- 0.51796281,
- 0.99555556,
- 0.84071826,
- 1.12549449,
- 1.19867769,
- 2.4775,
- ],
- )
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.88930748, 0.93655622, 1.36425875, 0.96388566, 3.55555556, 2.55601211],
- )
+ strand = Cube(CR.ECON_BLAME_WITH_HS).partitions[0]
+ np.testing.assert_almost_equal(strand.scale_mean, [2.17352056])
-def test_var_scale_means_for_univariate_with_hs():
+def test_univariate_with_hs_var_scale_means_row():
# Test without H&S
transforms = {
"columns_dimension": {"insertions": {}},
@@ -547,82 +558,3 @@ def test_var_scale_means_for_univariate_with_hs():
# Test with H&S
strand = Cube(CR.ECON_BLAME_WITH_HS).partitions[0]
np.testing.assert_almost_equal(strand.var_scale_mean, [1.1363901131679894])
-
-
-def test_var_scale_means_cat_x_cat_arr_subvars_first():
- slice_ = Cube(CR.FRUIT_X_PETS_ARRAY_SUBVARS_FIRST).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row, [0.2054321, 0.24, 0.22558594]
- )
- assert slice_.var_scale_means_column is None
-
- slice_ = Cube(CR.FRUIT_X_PETS_ARRAY_SUBVARS_FIRST).partitions[1]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row, [0.2283737, 0.21, 0.21606648]
- )
- assert slice_.scale_means_column is None
-
-
-def test_var_scale_means_cat_x_cat_pruning_and_hs():
- transforms = {
- "columns_dimension": {"insertions": {}},
- "rows_dimension": {"insertions": {}},
- }
- slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [1.4459092, 2.14619102, 2.40430987, np.nan, 0.87972883],
- )
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.72358198, 0.9991, 1.87633763, 0.4859843, np.nan, 0.66666667],
- )
-
- # Just H&S
- slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [1.4459092, 1.8494177, 2.14619102, 2.40430987, np.nan, 0.87972883],
- ),
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.72358198, 1.08423566, 0.9991, 1.87633763, 0.4859843, np.nan, 0.66666667],
- )
-
- # Just pruning
- transforms = {
- "rows_dimension": {"prune": True},
- "columns_dimension": {"prune": True},
- }
- slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [1.4459092, 1.8494177, 2.14619102, 2.40430987, 0.87972883],
- )
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.72358198, 1.08423566, 0.9991, 1.87633763, 0.4859843, 0.66666667],
- )
-
- # Pruning and H&S
- transforms = {
- "rows_dimension": {"insertions": {}, "prune": True},
- "columns_dimension": {"insertions": {}, "prune": True},
- }
- slice_ = Cube(CR.CAT_X_CAT_PRUNING_HS, transforms=transforms).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row, [1.4459092, 2.14619102, 2.40430987, 0.87972883]
- ),
- np.testing.assert_almost_equal(
- slice_.var_scale_means_column,
- [0.72358198, 0.9991, 1.87633763, 0.4859843, 0.66666667],
- )
-
-
-def test_var_scale_means_nps_type():
- slice_ = Cube(SM.FACEBOOK_APPS_X_AGE).partitions[0]
- np.testing.assert_almost_equal(
- slice_.var_scale_means_row,
- [1905.11600238, 2111.67820069, 1655.65636907, 981.86821176],
- )
- assert slice_.var_scale_means_column is None
diff --git a/tests/unit/legacy/test_cube_slice.py b/tests/unit/legacy/test_cube_slice.py
index 0eee6a6b9..1a0552c35 100644
--- a/tests/unit/legacy/test_cube_slice.py
+++ b/tests/unit/legacy/test_cube_slice.py
@@ -310,7 +310,7 @@ def it_knows_whether_its_a_double_mr(
((DT.LOGICAL,), False),
((DT.TEXT,), False),
((DT.CA_CAT,), False),
- ((DT.CA_SUBVAR, DT.CA_CAT), False),
+ ((DT.CA_SUBVAR, DT.CA_CAT), True),
((DT.CA_SUBVAR, DT.MR, DT.CA_CAT), False),
((DT.MR, DT.CAT), True),
((DT.LOGICAL, DT.CAT), False),