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
Problems with panel dataI am new to stata and I trying to run a regression to understand demographic roles in unemployment, …
How to Keep Duplicated Variables based on the Value of another ColumnHello all! I am working on cleaning up a dataset, and I do not know how to do so. Here are some of …
Measuring duration between age 13 and 19Hi people, Supposed i want to measure marriage timing among pregnant and non pregnant adolescents (a…
Compute Female proportion in each district in long format data in Stata. I have a long format dataset where it has 5 variables: did---district id sid---school id id--studen…
merging two panel data sets - 1:m mergingHello, I need help with two merging panel data sets according to the following variables: h_id, year…
Subscribe to:
Post Comments (Atom)
0 Response to Split string variable
Post a Comment