This function prepares a data frame for analysis by extracting, processing, and adding columns for EQ-5D variables, including state, LSS (Level Sum Score), LFS (Level Frequency Score) and utility.
names: character vector of length 5 with names of EQ-5D variables in the data frame. The variables should be in an integer format.
add_state: logical indicating whether the EQ-5D state should be added
add_lss: logical indicating whether the LSS (Level Sum Score) should be added
add_lfs: logical indicating whether the LFS (Level Frequency Score) should be added
add_utility: logical indicating whether the utility should be added
eq5d_version: character indicating the version of the EQ-5D questionnaire to use (either "3L" or "5L")
country: character indicating the country to retrieve the quality of life score for
Returns
a modified data frame with EQ-5D domain columns renamed to default names, and, if necessary, with added columns for state, LSS, LFS, and/or utility. If any of the checks fail (e.g. EQ-5D columns are not in an integer format), an error message is displayed and the function is stopping.