I have strL a variable (pgttype) that contains several results such as:
"Aneuploidy CRMI 13, 15, 16, 17, 18, 21, 22, X, Y"
"Translocation 46,XX,t(12;21)(q24.33;q22.13)"
"Aneuploidy CRMI 13, 15, 16, 17, 18, 21, 22, X, Y, Add Chromosome 14, Translocation 45,XY,der(13;14)(q10;q10), Gender Selection Pt Choice F"
I am trying to find a way to search within these long string variables to create a new variable (pgttype1) that discretely categorizes such as:
1) contains "aneuploidy" but does not contain "translocation"
or
2) contains "translocation" but does not contain "gender selection"
Can't seem to get it to work with regexm or strpos...
Any ideas?
Thanks in dance
Related Posts with Searching within strings
Generating the "opposing" variable in a long datasetHi all, I am using Stata 17/SE on Mac and I am having trouble generating a variable using another o…
convert string yyyy-mm-dd hh:mm:ss to %td formatHello, As the title of this question suggests, I have a set of data with variable "Qtm" in string f…
pweight with melogitI have a Panel dataset with 260,647 data points consisting of 260,647 Respondents within 43,400 hous…
Color changes with PNG export.On the left, we have the graph I actually want (ignore please the slight transparency difference bet…
Formal tests of volatility in STATA17Dear Statlist: I have longitudinal data on employee data across multiple years and organizations. I…
Subscribe to:
Post Comments (Atom)
0 Response to Searching within strings
Post a Comment