D-score / dscore

D-score for Child Development
https://d-score.org/dscore/
GNU Affero General Public License v3.0
8 stars 0 forks source link

An improved method to select the reference for calculating DAZ #54

Closed stefvanbuuren closed 4 months ago

stefvanbuuren commented 4 months ago

Currently, the age-conditional reference against the DAZ is calculated using a combination of the population and key arguments. However, this is no longer sufficient after the advent of multiple references from the same 'population'-'key' combination.

A user requested an option for an option to directly specify the reference from dscore() invocation.

A reference is tied to the D-score key used to calculate it. Hence, the procedure should check whether the requested reference is available under the D-score key.

Related to #50.

stefvanbuuren commented 4 months ago

In dscore 1.9.0 each reference is indexed by a combination of key and population. The available combinations are below:

library(dscore)
refs <- dscore::builtin_references
table(refs$key, refs$population)
#>           
#>            dutch gcdg phase1 preliminary_standards
#>   293_0        0    0    186                     0
#>   dutch      144    0      0                     0
#>   gcdg         0  121      0                     0
#>   gsed1912     0  121      0                     0
#>   gsed2212   185    0    186                     0
#>   gsed2406   185    0    186                   186

Created on 2024-06-12 with reprex v2.1.0

Thus, when working with gsed2406, we can ask for "dutch", "phase1" and "preliminary_standards".