Supplementary file 2 for “ Developing Australian utility value set for MacNew-7D heart disease-specific health states.” ################################################################################################################ ######## --- Instructions for calculating MacNew 7D utility scores from MacNew 27 items questionnaire --- ###### ################################################################################################################ ## --------------------- Data file -------------------------------------------------------------------------## # Data file should be in .csv format. # File name should be "MacNew_Questionnaire.csv" ## --------------------- Renaming variables ----------------------------------------------------------------## # For this code to work, it is assumed that the MacNew questionnaire results are set up as 27 columns, labelled q_1 to q_27. # Each of the columns can take one of seven values 1-7. # Variables used in MacNew 7D : q_26, q_24, q_1, q_6, q_15, q_9, q_14 ## --------------------------------------------------------------------------------------------------------## # ----------- Setting up the working directory # Set up the folder where the file "MacNew_Questionnaire.csv" located as the working directory # Load libraries library(dplyr) library(readr) # Load the dataset MacNew_Questionnaire = read.delim("MacNew_Questionnaire.csv", sep = ",") ## Recode level MacNew_Questionnaire = mutate(MacNew_Questionnaire, physical_restriction = case_when( q_26 == "1" ~ "4", q_26 == "2" ~ "3", q_26 == "3" ~ "3", q_26 == "4" ~ "3", q_26 == "5" ~ "2", q_26 == "6" ~ "2", q_26 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, excluded = case_when( q_24 == "1" ~ "4", q_24 == "2" ~ "3", q_24 == "3" ~ "3", q_24 == "4" ~ "3", q_24 == "5" ~ "2", q_24 == "6" ~ "2", q_24 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, frustrated = case_when( q_1 == "1" ~ "4", q_1 == "2" ~ "3", q_1 == "3" ~ "3", q_1 == "4" ~ "3", q_1 == "5" ~ "2", q_1 == "6" ~ "2", q_1 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, worn_out = case_when( q_6 == "1" ~ "4", q_6 == "2" ~ "3", q_6 == "3" ~ "3", q_6 == "4" ~ "3", q_6 == "5" ~ "2", q_6 == "6" ~ "2", q_6 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, self_confidence = case_when( q_15 == "1" ~ "4", q_15 == "2" ~ "3", q_15 == "3" ~ "3", q_15 == "4" ~ "3", q_15 == "5" ~ "2", q_15 == "6" ~ "2", q_15 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, shortness_of_breath = case_when( q_9 == "1" ~ "4", q_9 == "2" ~ "3", q_9 == "3" ~ "3", q_9 == "4" ~ "3", q_9 == "5" ~ "2", q_9 == "6" ~ "2", q_9 == "7" ~ "1", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, chest_pain = case_when( q_14 == "1" ~ "4", q_14 == "2" ~ "3", q_14 == "3" ~ "3", q_14 == "4" ~ "3", q_14 == "5" ~ "2", q_14 == "6" ~ "2", q_14 == "7" ~ "1", )) ## Anchoring values for each attribute level based on Conditional logit model MacNew_Questionnaire = mutate(MacNew_Questionnaire, physical_restriction_du = case_when( physical_restriction == "1" ~ "0", physical_restriction == "2" ~ "-0.1087", physical_restriction == "3" ~ "-0.1232", physical_restriction == "4" ~ "-0.3595", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, excluded_du = case_when( excluded == "1" ~ "0", excluded == "2" ~ "-0.0972", excluded == "3" ~ "-0.1055", excluded == "4" ~ "-0.1875", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, frustrated_du = case_when( frustrated == "1" ~ "0", frustrated == "2" ~ "-0.0337", frustrated == "3" ~ "-0.0578", frustrated == "4" ~ "-0.1727", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, worn_out_du = case_when( worn_out == "1" ~ "0", worn_out == "2" ~ "-0.0143", worn_out == "3" ~ "-0.0272", worn_out == "4" ~ "-0.0272", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, self_confidence_du = case_when( self_confidence == "1" ~ "0", self_confidence == "2" ~ "-0", self_confidence == "3" ~ "-0.0642", self_confidence == "4" ~ "-0.1119", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, shortness_of_breath_du = case_when( shortness_of_breath == "1" ~ "0", shortness_of_breath == "2" ~ "-0.0304", shortness_of_breath == "3" ~ "-0.0751", shortness_of_breath == "4" ~ "-0.2707", )) MacNew_Questionnaire = mutate(MacNew_Questionnaire, chest_pain_du = case_when( chest_pain == "1" ~ "0", chest_pain == "2" ~ "-0.0485", chest_pain == "3" ~ "-0.1257", chest_pain == "4" ~ "-0.2821", )) MacNew_Questionnaire = MacNew_Questionnaire %>% mutate_if(is.character,as.numeric) ## MacNew 7D utility value MacNew_Questionnaire = MacNew_Questionnaire %>% mutate(MacNew_7D_utlity = 1+(physical_restriction_du + excluded_du + frustrated_du + worn_out_du + self_confidence_du + shortness_of_breath_du + chest_pain_du)) ## CSV datafile MacNew_Questionnaire = MacNew_Questionnaire %>% select(q_1: chest_pain, MacNew_7D_utlity) write.csv(MacNew_Questionnaire,"MacNew_7D_utlity.csv", row.names = FALSE)