|
26 | 26 | #' be a number which is applied to the whole dataset. When a single |
27 | 27 | #' NICE DSU score is being calculated "age", "sex" and "bwidth" are also |
28 | 28 | #' 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. |
30 | 30 | #' @return a numeric vector of utility index scores. |
31 | 31 | #' @examples |
32 | 32 | #' |
@@ -255,20 +255,25 @@ eq5d.default <- function(scores, version=NULL, type=NULL, country=NULL, ignore.i |
255 | 255 |
|
256 | 256 | if(version=="3L") { |
257 | 257 | 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) |
259 | 259 | } 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) |
261 | 266 | } else if(!is.null(type) && type=="DSU") { |
262 | 267 | eq5dmap(scores, country, version, args$age, args$sex, bwidth, digits) |
263 | 268 | } else { |
264 | 269 | stop("EQ-5D-3L valueset type not recognised. Must be one of 'TTO', 'VAS', 'RCW' or 'DSU'.") |
265 | 270 | } |
266 | 271 | } else if (version=="Y3L") { |
267 | | - eq5dy3l(scores, country=country) |
| 272 | + eq5dy3l(scores, country=country, digits = digits) |
268 | 273 | } |
269 | 274 | else { |
270 | 275 | if(!is.null(type) && type=="VT") { |
271 | | - eq5d5l(scores, country=country) |
| 276 | + eq5d5l(scores, country=country, digits = digits) |
272 | 277 | } else if(!is.null(type) && type=="CW") { |
273 | 278 | eq5dcw(scores, country=country) |
274 | 279 | } else if(!is.null(type) && type=="DSU") { |
@@ -316,20 +321,24 @@ valuesets <- function(type=NULL, version=NULL, country=NULL, references=c("PubMe |
316 | 321 | tto <- data.frame(Version="EQ-5D-3L", Type="TTO", Country=colnames(TTO)) |
317 | 322 | vas <- data.frame(Version="EQ-5D-3L", Type="VAS", Country=colnames(VAS)) |
318 | 323 | 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)) |
319 | 325 | vt <- data.frame(Version="EQ-5D-5L", Type="VT", Country=colnames(VT)) |
320 | 326 | cw <- data.frame(Version="EQ-5D-5L", Type="CW", Country=colnames(CW)) |
321 | 327 | y <- data.frame(Version="EQ-5D-Y-3L", Type="cTTO", Country=colnames(Y3L)) |
322 | 328 | dsu3l <- data.frame(Version="EQ-5D-3L", Type="DSU", Country=sub("Copula", "", grep("Copula", sort(colnames(DSU3L)), value=TRUE))) |
323 | 329 | 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) |
325 | 330 |
|
| 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 | + |
326 | 337 | if(!is.null(type)) vs <- vs[vs$Type==type,] |
327 | 338 | if(!is.null(version)) vs <- vs[vs$Version==version,] |
328 | 339 | if(!is.null(country)) vs <- vs[grep(paste0("^",country), vs$Country),] |
329 | 340 | rownames(vs) <- NULL |
330 | 341 |
|
331 | | - vs <- merge(vs, REFERENCES, by = c("Version", "Type", "Country")) |
332 | | - |
333 | 342 | if(is.null(references)) { |
334 | 343 | vs <- vs[,c("Version", "Type", "Country")] |
335 | 344 | } else if (all(references %in% c("PubMed", "DOI", "ISBN", "ExternalURL"))) { |
|
0 commit comments