This function calculates the ages at which a certain percent in the reference population passes the items.

get_age_equivalent(
  items,
  pct = c(10, 50, 90),
  key = "gsed",
  itembank = dscore::builtin_itembank,
  population = key,
  xunit = c("decimal", "days", "months")
)

Arguments

items

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.

pct

Numeric vector with requested percentiles (0-100). The default is pct = c(10, 50, 90).

key

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".

itembank

A data.frame with columns named key, item and tau. The function uses dscore::builtin_itembank by default.

population

A string describing the population. Currently supported are "dutch" and "gcdg" (default).

xunit

A string specifying the unit in which age is measured (either "decimal", "days" or "months"). The default ("decimal") means decimal age in years.

Value

Tibble with four columns: item, d (D-score), pct (percentile), and a (age-equivalent, in xunit units).

Examples

get_age_equivalent(c("ddicmm030", "ddicmm050"), key = "dutch")
#> # A tibble: 6 × 4 #> item d pct a #> <chr> <dbl> <dbl> <dbl> #> 1 ddicmm030 9.10 10 0.0415 #> 2 ddicmm030 11.3 50 0.0656 #> 3 ddicmm030 13.5 90 0.0913 #> 4 ddicmm050 67.3 10 2.35 #> 5 ddicmm050 69.5 50 2.60 #> 6 ddicmm050 71.7 90 NA