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
how many observations per year in panel dataHi there, I have a panel dataset. How can I see how many observations there are per year? I see in …
Eliminate a part of a stringHello there, I would like to eliminate a part of a string starting from a position recorded in anoth…
How do you de-trend an event study plot?I have an event study graph that I plot using coefficients from my dependent variable regressed on t…
Setting the outcome variable in Cox regression.Hi, I am trying to estimate the hazard ratios of the age of first drinking, the goal is to measure …
Manually producing probabilites after logitDear All, I estimate a logit model and then I need to calculate Prob[Y=1|X], where X is my set of r…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting part of a string variable
Post a Comment