Missing dimensions

21 views
Skip to first unread message

Igor

unread,
Sep 6, 2024, 4:17:30 AM9/6/24
to json-stat
Hi.

Let assume we have following data:

Screenshot 2024-09-06 111141.png
I.e. sex dimension has 2 values: female and mail, route -- oral and intra, var -- AUC6 and AUC12. But not all possible strata (i.e. combination of sex, route and var)  were filled/measured/interested. 
Is it possible to represent such data with json-stat without introducing formal strata with nulls in value?

Regards,
Igor.

Simon Speich

unread,
Sep 6, 2024, 6:38:07 AM9/6/24
to json-stat

The JSON-stat schema allows for an "extension" property, where you can add whatever structure you want:  https://json-stat.org/format/#extension

We used this to define a property to list all the indexes where the values are systematically null and then excluded them from the value array.

Just an idea.

Simon

Simon Speich

unread,
Sep 6, 2024, 6:40:14 AM9/6/24
to json-stat
Sorry, not quite correct, we didn't exclude them from the value array, but used the information from the extension property to hide them when rendering and provided a show/hide function to the user.

Xavier Badosa

unread,
Sep 6, 2024, 1:25:01 PM9/6/24
to json...@googlegroups.com
If you have a lot of nulls due to missing data or impossible combinations of variables use an object instead an array of values:

Instead of:

value: [3, null, null, null, null, null, 25]

use

value: {"0": 3, "6": 25}

Xavier

--
You received this message because you are subscribed to the Google Groups "json-stat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to json-stat+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/json-stat/f99ad4f3-bce9-4391-9838-cfe16a5f5b8en%40googlegroups.com.

Igor

unread,
Sep 6, 2024, 2:46:15 PM9/6/24
to json-stat
Is it something like below?
  ...
  "dimension": {
  ...
  }, 
  "extension": {
    "id": "partial data",
    "stratas": {
      "exclude": [
        {"route": "intra","sex": "female"},
        {"route": "oral","sex": "male"},
        {"route": "intra","sex": "male","var": "AUC12"},
        {"route": "oral","sex": "male","var": "AUC12"}
      ]
    },
    "version": "0.1"
  },
  "value": [...]
}
That will need further processing/interpretation? 
If "Yes", this will mean that standard tools need to be extended in include additional logic.

Regards,
Igor.

Igor

unread,
Sep 6, 2024, 3:16:44 PM9/6/24
to json-stat
Got is, Xavier.
 
Data that I assume to store in json-stat format may not (or even  often will not) contain all combinations of dimension values. And number of "facts"/measurements may be quite big (experimental data and their derivatives).  NULLs will be ok but if not too many. And storing data as an object at a first glance looks too heavy for big datasets. As for now extensions with include/exclude definition of strata looks more promising. 

Regards,
Igor.

Xavier Badosa

unread,
Sep 7, 2024, 7:39:40 AM9/7/24
to json...@googlegroups.com
Igor,

You can use the structure you want inside an "extension" (as far as the extensions are in the allowed places -dataset-level extension, dimension-level extension). https://json-stat.org/format/#extension

JSON-stat libraries should provide a way to retrieve extension information but cannot process it as they can't know in advance its contents. So yes, you need to include the additional logic.

Xavier

Igor

unread,
Sep 9, 2024, 4:42:21 AM9/9/24
to json-stat
Hi  Xavier.

Can I summarize the answer on the topic as following?
1. json-stat suggest that data for all dimensions are presented.
2. If some data are not available, nulls may be used inplace in an array or json object for scarce data.
3. If some combinations of dimensions are missing or not used, an extension may be used. But it is a responsibility of user to write an appropriate validator/reader.

Ragards,
Igor.

Xavier Badosa

unread,
Sep 9, 2024, 11:24:45 AM9/9/24
to json...@googlegroups.com
That is sort of correct,

Xavier

Reply all
Reply to author
Forward
0 new messages