Hello all:
I have an excel sheet for a collection form that has dropdowns which accesses a separate sheet with all the dropdown choices for the variable using these dropdowns. I am trying to find the easiest way to write the dropdown choices within excel so I could assign numeric values to my value labels in Stata and define a label to use. See below for two variables each with their dropdown choices. I have a specific numeric assignment which I want for each of the value labels in line1ind for instance.
Is there a better prespecified format I could use in excel to list values next to each label so when I import this sheet into Stata, I can define the label more easily for all variables that need to be encoded without doing it label by label (0 "7+3-based" for instance). I also don't want to make it unreadable for the end user filling the data in excel using the dropdown choices.
See below the imported excel data and my final Stata label define that is quite manual.
I have an excel sheet for a collection form that has dropdowns which accesses a separate sheet with all the dropdown choices for the variable using these dropdowns. I am trying to find the easiest way to write the dropdown choices within excel so I could assign numeric values to my value labels in Stata and define a label to use. See below for two variables each with their dropdown choices. I have a specific numeric assignment which I want for each of the value labels in line1ind for instance.
Is there a better prespecified format I could use in excel to list values next to each label so when I import this sheet into Stata, I can define the label more easily for all variables that need to be encoded without doing it label by label (0 "7+3-based" for instance). I also don't want to make it unreadable for the end user filling the data in excel using the dropdown choices.
See below the imported excel data and my final Stata label define that is quite manual.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str20 line1ind str19 line1resp "7+3-based" "CR/CRi" "HMA" "Partial Response" "HMA-BCL2i" "SD/Non-response" "HiDAC-based" "Progressive Disease" "CPX-351/Vyxeos" "No data" "Other, Intensive" "" "Other, Low-intensive" "" "Supportive care only" "" "DLI" "" "AlloSCT" "" "Untreated" "" "Unknown" "" end
Code:
lab define linelbl /// 0 "7+3-based" /// 1 "Other, Intensive" /// 2 "HiDAC-based" /// 3 "HMA" /// 4 "HMA-BCL2i" /// 5 "CPX-351/Vyxeos" /// 6 "Other, Low-intensive" /// 7 "AlloSCT" /// 8 "DLI" /// 9 "Supportive care only" /// 10 "Untreated" /// 11 "Unknown"
Comment