Hi. I have a string variable that comprises of multiple words with no fixed order/that is not the same combination of words across rows/observations . I want to generate a new variable that is equal (extracts) certain words from the string variable. For example, my string variable may contain "Cancer, breast; worldwide, neuronal, launched". I want to generate a variable stage that extracts only "launched" for this particular row/observation. There are just five words that I want to extract from the string variable across the entire dataset and no single row/observation carries more than one of the words that I want to extract. Any guidance on how to do this will be much appreciated.
Thanks.
Related Posts with Extracting part of a string variable
Deleting a row header from a customized tableI am creating a Table 1 using the "collect" command in Stata. I would like to have a "Total" row at …
Mulitple CV graphs for lasso/elasticnet estimatesHi, I am running different regularized estimators, elasticnet and linear lasso. I want to plot Cross…
Boxplot of ProbabilitiesI've created a score that predicts mortality. Does anyone know what lines of code to use to create …
Picking initial values for a specificDear all, I have an unbalanced panel of 57,910 observations of country, industries and year (2003-2…
Importing and Assigning Data By YearHello, I'm working on a research paper in which I'm examining the relationship between sea surface …
Subscribe to:
Post Comments (Atom)
0 Response to Extracting part of a string variable
Post a Comment