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
Multivariate GARCH models - help needed with implementation and interpretationFor a research project, I'm investigating the connectedness between major financial markets from an …
logit model yield too high coefficientI ran a logit model Code: egen Banks=group(V) [/CODE] logit Collateraldummy Age Numberofemployee…
Cumulative frequencies and names of observations calculated across rows of different variablesHi Statalisters, Could someone help me with the below or direct me to any previous thread (which I …
Add confidence intervals to medianDear Stata users, I would like to add 95% confidence intervals to q50. But it does not appear to be…
Demand elasticityHi all, I am using stata to estimate demand for automobiles. I have panel data of 4 years 2014-2017…
Subscribe to:
Post Comments (Atom)
0 Response to Split string variable
Post a Comment