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
Cluster SE and Fixed Effects using mlogitDear Statalists, I do not have stata17 so I cannot use xtmlogit. The femlogit does not allow cluste…
Different combinations in each householdI have individual data set. With my dataset I want to create a living arrangement among elderly for …
How to label variables taking last part of variable namesI have numerous variables. For example, I have variables var1, var3, var6, var30. And I want to labe…
Fitting NL model with strictly positive dependent variable!I have estimated a model of the following form using NL: y=exp(xB)*(P^{gamma}) * (I^{theta}) + epsi…
Marginsplot for logistic regression?Hi guys Variables explained: splitvoter: 0= not split vote between two elections / 1= split vote b…
Subscribe to:
Post Comments (Atom)
0 Response to Searching within strings
Post a Comment