toEQ5DIndex
Generate EQ-5D state vector from data.frame/matrix or named vector with dimensions.
toEQ5Dindex(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x
: A data.frame, matrix, or vector containing dimension levels. Should have column names corresponding to the dim.names argument.dim.names
: A vector of dimension names in data.frame/matrix/vector xA vector of 5-digit EQ-5D health state indexes.
toEQ5Dindex(c(1,2,3,4,5)) example_data <- as.data.frame(matrix(data = c(1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 3, 2, 1, 2, 3), ncol = 5, byrow = TRUE, dimnames = list(NULL, c("mo", "sc", "ua", "pd", "ad")))) example_data$irrelevant <- c(6,5,3) toEQ5Dindex(example_data)
Useful links