Skip to content

Commit 5aaa6e1

Browse files
authored
Merge pull request #28 from fragla/crosswalk
van Hout (2021) reverse crosswalk models merged into main.
2 parents af3d13d + 1e686d7 commit 5aaa6e1

28 files changed

+448
-104
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Description: EQ-5D is a popular health related quality of life instrument used
2424
<doi:10.1007/978-94-007-7596-1>, 47 EQ-5D-5L EQ-VT value sets, the
2525
EQ-5D-5L crosswalk value sets developed by van Hout et al. (2012)
2626
<doi:10.1016/j.jval.2012.02.008>, the crosswalk value sets for Bermuda, Jordan and
27-
Russia and the reverse crosswalk value sets. 10 EQ-5D-Y value sets are also
28-
included as are the NICE 'DSU' age-sex based EQ-5D-3L to EQ-5D-5L and
29-
EQ-5D-5L to EQ-5D-3L mappings. Methods are also included for the analysis
30-
of EQ-5D profiles, including those from the book "Methods for Analyzing and
31-
Reporting EQ-5D data" by Devlin et al. (2020)
27+
Russia and the van Hout (2021) reverse crosswalk value sets. 10 EQ-5D-Y
28+
value sets are also included as are the NICE 'DSU' age-sex based EQ-5D-3L
29+
to EQ-5D-5L and EQ-5D-5L to EQ-5D-3L mappings. Methods are also included
30+
for the analysis of EQ-5D profiles, including those from the book "Methods
31+
for Analyzing and Reporting EQ-5D data" by Devlin et al. (2020)
3232
<doi:10.1007/978-3-030-47622-9>. Additionally a shiny web tool is included
3333
to enable the calculation, visualisation and automated statistical analysis
3434
of EQ-5D data via a web browser using EQ-5D dimension scores stored in CSV

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export(CW)
1616
export(DSU3L)
1717
export(DSU5L)
1818
export(RCW)
19+
export(RCWVH)
1920
export(TTO)
2021
export(VAS)
2122
export(VT)

NEWS.Rmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ knitr::opts_chunk$set(echo = TRUE)
1111

1212
- Moroccan EQ-5D-5L value set added.
1313

14+
- "digits" argument added to eq5d3l, eq5d5l and eq5dy3l functions to enable
15+
scores to be returned with more precision.
16+
17+
- van Hout (2021) reverse crosswalk method added to eq5drcw function. This is
18+
now the default and recommended option for mapping EQ-5D-3L to EQ-5D-5L. The
19+
previous EuroQol (2019) mappings can be accessed by specifying the
20+
`method = "EQ"` argument.
21+
1422
# eq5d 0.15.7 (2025-02-28)
1523

1624
- United Arab Emirates EQ-5D-5L value set added.

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
- Moroccan EQ-5D-5L value set added.
77

8+
- “digits” argument added to eq5d3l, eq5d5l and eq5dy3l functions to
9+
enable scores to be returned with more precision.
10+
11+
- van Hout (2021) reverse crosswalk method added to eq5drcw function.
12+
This is now the default and recommended option for mapping EQ-5D-3L to
13+
EQ-5D-5L. The previous EuroQol (2019) mappings can be accessed by
14+
specifying the `method = "EQ"` argument.
15+
816
# eq5d 0.15.7 (2025-02-28)
917

1018
- United Arab Emirates EQ-5D-5L value set added.

R/data.R

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@
6363
#' @export
6464
"DSU5L"
6565

66-
#' EQ-5D-3L Reverse Crosswalk data
66+
#' EQ-5D-3L Reverse Crosswalk data (deprecated)
6767
#'
6868
#' Reverse Crosswalk index value table to calculate EQ-5D-5L indices from EQ-5D-3L data
69-
#' for England, Germany, Netherlands and USA. Table uses the values of van Hout et al
70-
#' from the EuroQol analysis tools webpage.
69+
#' for England, Germany, Netherlands and USA. Table uses the values published
70+
#' on the EuroQol analysis tools webpage based on reverse engineering of
71+
#' van Hout et al (2012)
7172
#'
7273
#' @source
7374
#' \href{https://euroqol.org/information-and-support/resources/value-sets/}{Reverse crosswalk datasets}
@@ -76,6 +77,18 @@
7677
#' @export
7778
"RCW"
7879

80+
#' EQ-5D-3L Reverse Crosswalk data
81+
#'
82+
#' Reverse Crosswalk index value table to calculate EQ-5D-5L indices from EQ-5D-3L data
83+
#' using the van Hout et al (2021) method.
84+
#'
85+
#' @source
86+
#' \doi{10.1016/j.jval.2021.03.009}
87+
#'
88+
#' @name RCWVH
89+
#' @export
90+
"RCWVH"
91+
7992
#' EQ-5D-3L TTO value set data
8093
#'
8194
#' Coefficients for the estimation of the EQ-5D-3L index values based on TTO valuation studies

R/eq5d.R

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' be a number which is applied to the whole dataset. When a single
2727
#' NICE DSU score is being calculated "age", "sex" and "bwidth" are also
2828
#' used. See \code{\link{eq5dmap}} for valid options. "digits" can also be
29-
#' used to return NICE DSU mapping scores with more precision.
29+
#' used to return scores with more precision.
3030
#' @return a numeric vector of utility index scores.
3131
#' @examples
3232
#'
@@ -255,20 +255,25 @@ eq5d.default <- function(scores, version=NULL, type=NULL, country=NULL, ignore.i
255255

256256
if(version=="3L") {
257257
if(!is.null(type) && type %in% c("TTO", "VAS")) {
258-
eq5d3l(scores, type=type, country=country)
258+
eq5d3l(scores, type=type, country=country, digits = digits)
259259
} else if(!is.null(type) && type=="RCW") {
260-
eq5drcw(scores, country=country)
260+
if(is.null(args$method)) {
261+
method <- "VH"
262+
} else {
263+
method <- args$method
264+
}
265+
eq5drcw(scores, country=country, method=method, digits = digits)
261266
} else if(!is.null(type) && type=="DSU") {
262267
eq5dmap(scores, country, version, args$age, args$sex, bwidth, digits)
263268
} else {
264269
stop("EQ-5D-3L valueset type not recognised. Must be one of 'TTO', 'VAS', 'RCW' or 'DSU'.")
265270
}
266271
} else if (version=="Y3L") {
267-
eq5dy3l(scores, country=country)
272+
eq5dy3l(scores, country=country, digits = digits)
268273
}
269274
else {
270275
if(!is.null(type) && type=="VT") {
271-
eq5d5l(scores, country=country)
276+
eq5d5l(scores, country=country, digits = digits)
272277
} else if(!is.null(type) && type=="CW") {
273278
eq5dcw(scores, country=country)
274279
} else if(!is.null(type) && type=="DSU") {
@@ -316,20 +321,24 @@ valuesets <- function(type=NULL, version=NULL, country=NULL, references=c("PubMe
316321
tto <- data.frame(Version="EQ-5D-3L", Type="TTO", Country=colnames(TTO))
317322
vas <- data.frame(Version="EQ-5D-3L", Type="VAS", Country=colnames(VAS))
318323
rcw <- data.frame(Version="EQ-5D-3L", Type="RCW", Country=colnames(RCW))
324+
rcwvh <- data.frame(Version="EQ-5D-3L", Type="RCW", Country=colnames(RCWVH))
319325
vt <- data.frame(Version="EQ-5D-5L", Type="VT", Country=colnames(VT))
320326
cw <- data.frame(Version="EQ-5D-5L", Type="CW", Country=colnames(CW))
321327
y <- data.frame(Version="EQ-5D-Y-3L", Type="cTTO", Country=colnames(Y3L))
322328
dsu3l <- data.frame(Version="EQ-5D-3L", Type="DSU", Country=sub("Copula", "", grep("Copula", sort(colnames(DSU3L)), value=TRUE)))
323329
dsu5l <- data.frame(Version="EQ-5D-5L", Type="DSU", Country=sub("Copula", "", grep("Copula", sort(colnames(DSU5L)), value=TRUE)))
324-
vs <- rbind(tto, vas, rcw, vt, cw, y, dsu3l, dsu5l)
325330

331+
vs1 <- rbind(tto, vas, rcw, vt, cw, y, dsu3l, dsu5l)
332+
vs1 <- merge(vs1, REFERENCES, by = c("Version", "Type", "Country"))
333+
334+
vs2 <- cbind(rcwvh, REFERENCES[REFERENCES$Type=="RCW" & is.na(REFERENCES$Country),!names(REFERENCES) %in% c("Country", "Version", "Type")], row.names = NULL)
335+
vs <- rbind(vs1, vs2)
336+
326337
if(!is.null(type)) vs <- vs[vs$Type==type,]
327338
if(!is.null(version)) vs <- vs[vs$Version==version,]
328339
if(!is.null(country)) vs <- vs[grep(paste0("^",country), vs$Country),]
329340
rownames(vs) <- NULL
330341

331-
vs <- merge(vs, REFERENCES, by = c("Version", "Type", "Country"))
332-
333342
if(is.null(references)) {
334343
vs <- vs[,c("Version", "Type", "Country")]
335344
} else if (all(references %in% c("PubMed", "DOI", "ISBN", "ExternalURL"))) {

R/eq5d3l.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
#' Mobility, Self-care, Usual activities, Pain/discomfort and Anxiety/depression.
88
#' @param type 3L values set type. Either TTO or VAS.
99
#' @param country value set country.
10+
#' @param digits number of decimal places to return.
1011
#' @return calculated utility index score.
1112
#' @examples
1213
#' eq5d3l(scores=c(MO=1,SC=2,UA=3,PD=1,AD=3), type="VAS", country="UK")
1314
#' eq5d3l(scores=c(MO=3,SC=2,UA=3,PD=2,AD=3), type="TTO", country="Germany")
1415
#'
1516
#' @export
16-
eq5d3l <- function(scores, type="TTO", country="UK") {
17+
eq5d3l <- function(scores, type="TTO", country="UK", digits=3) {
1718

1819
if(!all(.get_dimension_names() %in% names(scores))) {
1920
stop("Unable to identify EQ-5D dimensions in scores.")
@@ -49,7 +50,7 @@ eq5d3l <- function(scores, type="TTO", country="UK") {
4950
index <- .eq5d3l.add(values)
5051
}
5152

52-
return(round(index, digits=3))
53+
return(round(index, digits=digits))
5354
}
5455

5556
.eq5d3l.add <- function(values) {

R/eq5d5l.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
#' @param scores numeric with names MO, SC, UA, PD and AD representing
77
#' Mobility, Self-care, Usual activities, Pain/discomfort and Anxiety/depression.
88
#' @param country value set country.
9+
#' @param digits number of decimal places to return.
910
#' @return calculated utility index score.
1011
#' @examples
1112
#' eq5d5l(scores=c(MO=1,SC=2,UA=3,PD=4,AD=5), country="England")
1213
#' eq5d5l(scores=c(MO=3,SC=2,UA=5,PD=2,AD=3), country="Netherlands")
1314
#'
1415
#' @export
15-
eq5d5l <- function(scores, country="England") {
16+
eq5d5l <- function(scores, country="England", digits = 3) {
1617

1718
if(!all(.get_dimension_names() %in% names(scores)))
1819
stop("Unable to identify EQ-5D dimensions in scores.")
@@ -35,7 +36,7 @@ eq5d5l <- function(scores, country="England") {
3536
.N4(scores,survey),
3637
.N5(scores,survey))
3738

38-
return(round(sum(values, na.rm = TRUE), digits=3))
39+
return(round(sum(values, na.rm = TRUE), digits=digits))
3940
}
4041

4142
.level4Or5 <- function(scores, survey) {

R/eq5drcw.R

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,36 @@
66
#' @param scores numeric with names MO, SC, UA, PD and AD representing
77
#' Mobility, Self-care, Usual activities, Pain/discomfort and Anxiety/depression.
88
#' @param country value set country.
9+
#' @param method crosswalk values to use. Either "VH" (Van Hout, 2021) or "EQ"
10+
#' (EuroQol 2019 values). The van Hout method is recommended.
11+
#' @param digits number of decimal places to return.
912
#' @return calculated utility index score.
1013
#' @examples
1114
#' eq5drcw(scores=c(MO=1,SC=2,UA=3,PD=2,AD=1), country="Netherlands")
1215
#' eq5drcw(scores=c(MO=3,SC=3,UA=3,PD=3,AD=3), country="Germany")
1316
#'
1417
#' @export
15-
eq5drcw <- function(scores, country="UK") {
18+
eq5drcw <- function(scores, country="UK", method="VH", digits = 3) {
1619
if(!all(.get_dimension_names() %in% names(scores))) {
1720
stop("Unable to identify EQ-5D dimensions in scores.")
1821
}
22+
23+
if(!method %in% c("VH", "EQ")) {
24+
stop("Unable to identify reverse crosswalk values to use.")
25+
}
1926

2027
if(!all(scores %in% 1:3))
2128
stop("Scores must be coded as 1, 2, or 3 for EQ-5D-3L Reverse Crosswalk.")
22-
23-
survey <- RCW
24-
29+
30+
if(method == "VH") {
31+
survey <- RCWVH
32+
} else {
33+
survey <- RCW
34+
}
35+
2536
if(is.null(country) || !country %in% colnames(survey))
2637
stop(paste("For EQ-5D-3L reverse crosswalk value sets country must be one of:", paste(colnames(survey), collapse=", ")))
2738

28-
return(survey[paste(scores, collapse=""), country])
39+
return(round(survey[paste(scores, collapse=""), country], digits))
2940
}
41+

R/eq5dy3l.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
#' @param scores numeric with names MO, SC, UA, PD and AD representing
77
#' Mobility, Self-care, Usual activities, Pain/discomfort and Anxiety/depression.
88
#' @param country value set country.
9+
#' @param digits number of decimal places to return.
910
#' @return calculated utility index score.
1011
#' @examples
1112
#' eq5dy3l(scores=c(MO=3,SC=3,UA=3,PD=3,AD=3), country="Slovenia")
1213
#'
1314
#' @export
14-
eq5dy3l <- function(scores, country=NULL) {
15+
eq5dy3l <- function(scores, country=NULL, digits=3) {
1516

1617
if(!all(.get_dimension_names() %in% names(scores)))
1718
stop("Unable to identify EQ-5D dimensions in scores.")
@@ -34,7 +35,7 @@ eq5dy3l <- function(scores, country=NULL) {
3435
values <- c(survey["FullHealth"],
3536
.intercept(scores, survey), .power(scores, survey), .all3(scores, survey))
3637

37-
return(round(sum(values, na.rm = TRUE), digits=3))
38+
return(round(sum(values, na.rm = TRUE), digits=digits))
3839
}
3940

4041
#' Calculate EQ-5D-Y index scores

0 commit comments

Comments
 (0)