Hello all:
I am trying to split multiple treatment regimens in the CLLtx column and tally the number of treatment lines (clltxn). There are commas and semicolons separating the treatment regimens and generally most are usually acronynms. Some that have missing data, ., or "None" or "No treatment given" should also have a 0 in number of treatment lines.
I tried changing all commas to semicolons and tried splitting. But some of the 0 are coded as 1. But obviously, I am unable to change those 0 to 1 when only BR or one line of chemo or Radiation was given because it cannot see a semicolon.
This is the best I could but you will see it miscodes "EBRT" as 0 since it could not find a semicolon (all treatments seem to end in an upper case letter and I dont know how add another clause to code as 1 when it finds the ending letter as upper case).
gen clltxbetter = ustrregexra(CLLtx, ",", ";") //replace all comma to semicolon
gen clltxn = ustrregexm(clltxbetter, ";") //if semicolon then a match of 1
replace clltxn = length(clltxbetter) - length(subinstr(clltxbetter, ";", "", .)) + 1 if clltxn == 1
replace clltxn = 1 in 56 // CALGB trial is FCR and alemtuzumab
order clltxn, after(CLLtx)
I am trying to split multiple treatment regimens in the CLLtx column and tally the number of treatment lines (clltxn). There are commas and semicolons separating the treatment regimens and generally most are usually acronynms. Some that have missing data, ., or "None" or "No treatment given" should also have a 0 in number of treatment lines.
I tried changing all commas to semicolons and tried splitting. But some of the 0 are coded as 1. But obviously, I am unable to change those 0 to 1 when only BR or one line of chemo or Radiation was given because it cannot see a semicolon.
This is the best I could but you will see it miscodes "EBRT" as 0 since it could not find a semicolon (all treatments seem to end in an upper case letter and I dont know how add another clause to code as 1 when it finds the ending letter as upper case).
gen clltxbetter = ustrregexra(CLLtx, ",", ";") //replace all comma to semicolon
gen clltxn = ustrregexm(clltxbetter, ";") //if semicolon then a match of 1
replace clltxn = length(clltxbetter) - length(subinstr(clltxbetter, ";", "", .)) + 1 if clltxn == 1
replace clltxn = 1 in 56 // CALGB trial is FCR and alemtuzumab
order clltxn, after(CLLtx)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str102(CLLtx clltxbetter) float clltxn "FCR, Ibrutinib" "FCR; Ibrutinib" 2 "FCO" "FCO" 0 "" "" 0 "" "" 0 "" "" 0 "Chlorambucil, Rituximab, Ibrutinib, Idelalisib/Rituximab, Venetoclax" "Chlorambucil; Rituximab; Ibrutinib; Idelalisib/Rituximab; Venetoclax" 5 "Ibrutinib" "Ibrutinib" 0 "PCR, BR, Ibrutinib" "PCR; BR; Ibrutinib" 3 "Ibrutinib, Entospletinib, Obintuzumab" "Ibrutinib; Entospletinib; Obintuzumab" 3 "BR" "BR" 0 "BR, FCR, Solumerol/Rituximab, Ibrutinib" "BR; FCR; Solumerol/Rituximab; Ibrutinib" 4 "" "" 0 "FCR, Venetoclax, ABT-199" "FCR; Venetoclax; ABT-199" 3 "BR, IVIG" "BR; IVIG" 2 "FCR" "FCR" 0 "EPOCH-R, DA-EPOCH-R" "EPOCH-R; DA-EPOCH-R" 2 "Prednisone/Chlorambucil, Rituximab, Ibrutinib" "Prednisone/Chlorambucil; Rituximab; Ibrutinib" 3 "FCR" "FCR" 0 "" "" 0 "" "" 0 "FCR" "FCR" 0 "Ibrutinib" "Ibrutinib" 0 "R-CVP, Rituximab (maintenance), FCR, Ibritumomab tiuxetan, Ibrutinib, ABT-199" "R-CVP; Rituximab (maintenance); FCR; Ibritumomab tiuxetan; Ibrutinib; ABT-199" 6 "Chlorambucil, Fludarabine/Rituximab, BR, Ibrutinib" "Chlorambucil; Fludarabine/Rituximab; BR; Ibrutinib" 4 "" "" 0 "FCR, BR" "FCR; BR" 2 "FCR, BR" "FCR; BR" 2 "Prednisone/Chlorambucil, FCR, BR" "Prednisone/Chlorambucil; FCR; BR" 3 "" "" 0 "BR" "BR" 0 "Fludarabine, FCR, Bendamustine, FC" "Fludarabine; FCR; Bendamustine; FC" 4 "" "" 0 "" "" 0 "" "" 0 "SCT" "SCT" 0 "Fludarabine/Rituximab, Alemtuzumab, RT, R-CHOP" "Fludarabine/Rituximab; Alemtuzumab; RT; R-CHOP" 4 "" "" 0 "" "" 0 "Fludarabine, Cyclophosphamide, RT, BR" "Fludarabine; Cyclophosphamide; RT; BR" 4 "FCR, Alemtuzumab, SCT" "FCR; Alemtuzumab; SCT" 3 "Chlorambucil/Prednisone/Allopurinol, Rituximab, CHOP, FCR, Alvocidib" "Chlorambucil/Prednisone/Allopurinol; Rituximab; CHOP; FCR; Alvocidib" 5 "Fludarabine/Cyclophosphamide, Alemtuzumab, Pentostatin/Cyclophosphamide/Rituximab" "Fludarabine/Cyclophosphamide; Alemtuzumab; Pentostatin/Cyclophosphamide/Rituximab" 3 "" "" 0 "" "" 0 "Chlorambucil/Allopurinol" "Chlorambucil/Allopurinol" 0 "Cyclophosphamide/Fludarabine" "Cyclophosphamide/Fludarabine" 0 "Fludarabine/Rituximab" "Fludarabine/Rituximab" 0 "FCR" "FCR" 0 "" "" 0 "FCR, Chlorambucil" "FCR; Chlorambucil" 2 "" "" 0 "None" "None" 0 "Cetuximab, Cetuximab/Fludarabine, Rituximab/Fludarabine/Cyclophosphamide, Rituximab, R-CHOP" "Cetuximab; Cetuximab/Fludarabine; Rituximab/Fludarabine/Cyclophosphamide; Rituximab; R-CHOP" 5 "" "" 0 "Rituximab, Chlorambucil, Fludarabine/Cyclophosphamide, Prednisone/Vincristine/Rituximab" "Rituximab; Chlorambucil; Fludarabine/Cyclophosphamide; Prednisone/Vincristine/Rituximab" 4 "CALGB trial 10101" "CALGB trial 10101" 1 "Cyclophosphamide, R-CVP" "Cyclophosphamide; R-CVP" 2 "" "" 0 "Fludarabine/Rituximab, Fludarabine/Alemtuzumab" "Fludarabine/Rituximab; Fludarabine/Alemtuzumab" 2 "" "" 0 "Fludarabine/Cyclophosphamide" "Fludarabine/Cyclophosphamide" 0 "CHOP, R-CHOP, FCR" "CHOP; R-CHOP; FCR" 3 "" "" 0 "Fludarabine, Rituximab, Fludarabine/Rituximab, CHOP, Alemtuzumab, Cyclophosphamide/Rituximab/Steroids" "Fludarabine; Rituximab; Fludarabine/Rituximab; CHOP; Alemtuzumab; Cyclophosphamide/Rituximab/Steroids" 6 "Chlorambucil/Prednisone, Fludarabine/Oblimersen/Cyclophosphamide" "Chlorambucil/Prednisone; Fludarabine/Oblimersen/Cyclophosphamide" 2 "" "" 0 "FCR" "FCR" 0 "" "" 0 "Fludarabine" "Fludarabine" 0 "IVIG/Prednisone, Fludarabine/Rituximab, Vincristine/Prednisone" "IVIG/Prednisone; Fludarabine/Rituximab; Vincristine/Prednisone" 3 "CHOPP, Fludarabine, Cyclophosphamide, Vincristine, Rituximab" "CHOPP; Fludarabine; Cyclophosphamide; Vincristine; Rituximab" 5 "Chlorambucil/Prednisone, CHOP, Fludarabine/Cyclophosphamide, Fludarabine" "Chlorambucil/Prednisone; CHOP; Fludarabine/Cyclophosphamide; Fludarabine" 4 "" "" 0 "Fludarabine/Mitoxantrone, Fludarabine/Rituximab" "Fludarabine/Mitoxantrone; Fludarabine/Rituximab" 2 "Fludarabine" "Fludarabine" 0 "" "" 0 "Fludarabine/Rituximab, Bendomustine/Rituximab, Imatinib, Ibrutinib/Nilotinib, Nilotinib" "Fludarabine/Rituximab; Bendomustine/Rituximab; Imatinib; Ibrutinib/Nilotinib; Nilotinib" 5 "Ibrutinib, R-CHOP" "Ibrutinib; R-CHOP" 2 "BR" "BR" 0 "Alemtuzumab/Ofatumomab, Ibrutinib, Venetoclax, Ibrutinib/Venetoclax, Obinutuzumab/Ibrutinib/Venetoclax" "Alemtuzumab/Ofatumomab; Ibrutinib; Venetoclax; Ibrutinib/Venetoclax; Obinutuzumab/Ibrutinib/Venetoclax" 5 "BR" "BR" 0 "Chemotherapy (type not specified)" "Chemotherapy (type not specified)" 0 "" "" 0 "BR, R-CHOP, Ibrutinib, Venetoclax/Rituximab" "BR; R-CHOP; Ibrutinib; Venetoclax/Rituximab" 4 "Fludarabine/Cyclophosphamide" "Fludarabine/Cyclophosphamide" 0 "" "" 0 "BR, Ibrutinib, Venetoclax" "BR; Ibrutinib; Venetoclax" 3 "Ibrutinib, Acalabrutinib" "Ibrutinib; Acalabrutinib" 2 "FCR, Ibrutinib" "FCR; Ibrutinib" 2 "Ofatumumab/Fludarabine/Cyclophosphamide, Acalabrutinib" "Ofatumumab/Fludarabine/Cyclophosphamide; Acalabrutinib" 2 "FCR, Ibrutinib, Venetoclax" "FCR; Ibrutinib; Venetoclax" 3 "Ibrutinib" "Ibrutinib" 0 "Venetoclax/Ibrutinib" "Venetoclax/Ibrutinib" 0 "Acalabrutinib" "Acalabrutinib" 0 "" "" 0 "FCR, Rituximab" "FCR; Rituximab" 2 "Chlorambucil/Obinutuzumab" "Chlorambucil/Obinutuzumab" 0 "EBRT" "EBRT" 0 "Chemotherapy (type not specified)" "Chemotherapy (type not specified)" 0 "Ibrutinib, Venetoclax" "Ibrutinib; Venetoclax" 2 end
Comment