Hi, I'm still trying to clean a super dirty variable with lots of text in it.
The variable is pre-operative uterine size. Instead of just numbers though, there's lots of text sometimes associated with the numbers. I pulled out all the variations of text and came up with a list and wanted to apply it to the variable with the following command but...can't get it to work, any suggestions:
restring size_bimannual_h_p, gen (utsizehp) ignore (x)
where x is the paragraph of text below.
I have each phrase as it appears in the dataset with quotations around the text.
I wasn't sure a) how to make this work, clearly ;), b) if I should separate with parentheses or not
Any help is greatly appreciated!
x =
("small" "bicornate v dedelphys" "difficult pelvic exam 2/2 pt discomfort" "wk size ut" "weeks" "slightly enlarged" "wks" "wk uterus" "large" "wk" "irregular" "small, retroverted" "normal" "mobile but wide," "~" "Bulky uterus, ant. displaced" "small mobile uterus" "wk size uterus" "10x6x6 cm uterus" "small RV" "'normal size'" "large uterine mass" "large uterine size" "wk size" "enlarged" "wk size" "bulky" "palpable abd mass to umbilicus centrally" "large" "cm size uterus, midline" "tiny" "week size uterus" "+" "HTN, depression, knee pain" "slightly enlarged" "wk ut" "large uterine mass (not distinct from uterus)" "small," "large, 7cm above umb." "fundus 11 weeks, bulk palpable on R to 15 weeks" "irregular (two upward arrows) size ut." "mobile wide uterus" "large," "obese" "mobile" "ut" "wks" "size" "cm" "very small" "globularly" "uterus" "to" "mobile," "cm, large out mass (?)" "bulbous" "myomatous" "small mobile uterus" "n due to guarding" "NSS uterus--lemon size" "DMT2, HTN, hypothyroid, s/p colon CA" "regular-shaped" "smalll" "difficult to assess due to obesity")