The function dscore()
function estimates the D-score,
a numeric score that measures child development, from PASS/FAIL
observations on milestones.
dscore(
data,
items = names(data),
xname = "age",
xunit = c("decimal", "days", "months"),
key = "gsed",
itembank = dscore::builtin_itembank,
metric = c("dscore", "logit"),
prior_mean = ".gcdg",
prior_sd = NULL,
transform = NULL,
qp = -10:100,
population = key,
dec = 3L
)dscore_posterior(
data,
items = names(data),
xname = "age",
xunit = c("decimal", "days", "months"),
key = "gsed",
itembank = dscore::builtin_itembank,
metric = c("dscore", "logit"),
prior_mean = ".gcdg",
prior_sd = NULL,
transform = NULL,
qp = -10:100,
population = key,
dec = 3L
)
A data.frame
with the data.
A row collects all observations made on a child on a set of
milestones administered at a given age. The function calculates
a D-score for each row. Different rows correspond to different
children or different ages.
A character vector containing names of items to be
included into the D-score calculation. Milestone scores are coded
numerically as 1
(pass) and 0
(fail). By default,
D-score calculation is done on all items found in the data
that have a difficulty parameter under the specified key
.
A string with the name of the age variable in
data
. The default is "age"
.
A string specifying the unit in which age is measured
(either "decimal"
, "days"
or "months"
).
The default ("decimal"
) means decimal age in years.
A string that sets the key, the set of difficulty
estimates from a fitted Rasch model.
The built-in keys are: "gsed"
(default), "gcdg"
,
and "dutch"
. Use key = ""
to use all item names,
which should only be done if there are no duplicate itemnames.
A data.frame
with columns
key
, item
, tau
, instrument
, domain
,
mode
, number
and label
. Only columns item
and tau
are required.
The function uses dscore::builtin_itembank
by
default.
A string, either "dscore"
(default) or
"logit"
, signalling the metric in which ability is estimated.
A string specifying a column name in data
with the mean of the prior for the D-score calculation.
The default prior_mean = ".gcdg"
calculates an age-dependent
prior mean internally according to function
dscore:::count_mu_gcdg()
.
The choice prior_mean = ".dutch"
calculates prior_mean
from the Count model coded in
dscore:::count_mu_dutch()
).
A string specifying a column name in data
with the standard deviation of the prior for the D-score calculation.
If not specified, the standard deviation is taken as 5.
Vector of length 2, signalling the intercept
and slope respectively of the linear transform that converts an
observation in the logit scale to the the D-score scale. Only
needed if metric == "logit"
.
Numeric vector of equally spaced quadrature points.
This vector should span the range of all D-score values. The default
(qp = -10:100
) is suitable for age range 0-4 years.
A string describing the population. Currently
supported are "dutch"
and "gcdg"
(default).
Integer specifying the number of decimals for
rounding the ability estimates and the DAZ. The default is
dec = 3
.
The dscore()
function returns a data.frame
with
nrow(data)
rows and the following columns:
Name | Label |
a |
Decimal age |
n |
Number of items with valid (0/1) data |
p |
Percentage of passed milestones |
d |
Ability estimate, mean of posterior |
sem |
Standard error of measurement, standard deviation of the posterior |
daz |
D-score corrected for age, calculated in Z-scale |
The dscore_posterior()
function returns a numeric matrix with
nrow(data)
rows and length(qp)
columns with the
density at each quadrature point. The vector represents the full
posterior ability distribution. If no valid responses were obtained,
dscore_posterior()
returns the prior.
The algorithm is based on the method by Bock and Mislevy (1982). The method uses Bayes rule to update a prior ability into a posterior ability.
The item names should correspond to the "gsed"
lexicon.
The built-in itembank (object builtin_itembank()
) supports
keys "gsed"
(default), "gcdg"
and "dutch"
.
A key is defined by the set of estimated item difficulties.
Key | Model | Quadrature | Instruments | Direct/Caregiver | Reference |
"dutch" |
75_0 |
-10:80 |
1 | direct | Van Buuren, 2014/2020 |
"gcdg" |
565_18 |
-10:100 |
14 | direct | Weber, 2019 |
"gsed" |
807_17 |
-10:100 |
20 | mixed | GSED Team, 2019 |
As a general rule, one should only compare D-scores
that are calculated using the same key and the same
set of quadrature points. For calculating D-scores on new data,
the advice is to use the most general key, "gsed"
.
The default starting prior is a mean calculated from a so-called
"Count model" that describes mean D-score as a function of age. The
Count models are stored as internal functions
dscore:::count_mu_gcdg()
(default) and
dscore:::count_mu_dutch()
. The spread of the starting prior
is 5 D-score points around this mean D-score, which corresponds to
approximately twice the normal spread of child of a given age. The
starting prior is thus somewhat informative for low numbers of
valid items, and unformative for large number of items (say >10 items).
Bock DD, Mislevy RJ (1982). Adaptive EAP Estimation of Ability in a Microcomputer Environment. Applied Psychological Measurement, 6(4), 431-444.
Van Buuren S (2014). Growth charts of human development. Stat Methods Med Res, 23(4), 346-368. pdf
Van Buuren S, Dusseldorp E, Doove B (2017). D-scores and references for ages 2-4 years. The Netherlands. In preparation, 2017-11-27.
Weber AM, Rubio-Codina M, Walker SP, van Buuren S, Eekhout I, Grantham-McGregor S, Caridad Araujo M, Chang SM, Fernald LCH, Hamadani JD, Hanlon A, Karam SM, Lozoff B, Ratsifandrihamanana L, Richter L, Black MM (2019). The D-score: a metric for interpreting the early development of infants and toddlers across global settings. BMJ Global Health, BMJ Global Health 4: e001724. pdf.
get_tau()
,
builtin_itembank()
, posterior()
,
builtin_references()
# NOT RUN {
data <- data.frame(
age = rep(round(21 / 365.25, 4), 10),
ddifmd001 = c(NA, NA, 0, 0, 0, 1, 0, 1, 1, 1),
ddicmm029 = c(NA, NA, NA, 0, 1, 0, 1, 0, 1, 1),
ddigmd053 = c(NA, 0, 0, 1, 0, 0, 1, 1, 0, 1)
)
items <- names(data)[2:4]
# third item is not part of default key
get_tau(items)
# calculate D-score
dscore(data)
# calculate full posterior
p <- dscore_posterior(data)
# plot posterior for row 7
plot(x = -10:100, y = p[7, ], type = "l", xlab = "D-score",
ylab = "Density", xlim = c(0, 30))
# }
Run the code above in your browser using DataLab