Hi everyone,
I have a string var and I would like to split that var to get the last part of the string text, say the string var has dataset as below:
name
adam smith
julia jig
beffy mark
And I want to get the last part of this dataset, which is "smith", "jig" and "mark'.
I have tried to use the command as below but it does not work:
-- egen newvar=ends(name) trim[last]
Could anyone help me to sold this issue. Sorry if this question is a basic one. I've searched on google but I cannot find the solution yet.
Thank you a lot
Kind regards
Linh
Related Posts with Split string variable
help with installing -listcoef- to Stata13Hi, I have stata13 on my computer and I typed -findit listcoef- in the stata window. I see the optio…
using inlist with external dataHello, I am trying to identify how to use inlist with external data. Currently, I have two separate…
Dynamic GMM vs local projection vs Time-varying parameters (TVP) model selectionI am having a macro panel where I assume some sort of political ideology indicators (left -right) an…
inquire about preserve and restoreI need to drop tons of variables in my data set for panel A task. And I need to go back to the origi…
Stata manual for -ml- does not explain what -gtol()- refers toDear Statalisters, I have seen commands in -ml- that use as an option -gtol()-. For example, in thi…
Subscribe to:
Post Comments (Atom)
0 Response to Split string variable
Post a Comment