toEQ5Dindex {eq5dsuite}R Documentation

toEQ5DIndex

Description

Generate EQ-5D state vector from data.frame/matrix or named vector with dimensions.

Usage

toEQ5Dindex(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))

Arguments

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 x

Value

A vector of 5-digit EQ-5D health state indexes.

Examples

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)

[Package eq5dsuite version 1.0.0 Index]