If I have the following string variable with these entries:
median_age_____
median_age_group1__
median_age_group23___
median_age_group23456
median_age_group234__
...
What is the best way to get the following, given that at the end of each string "_" is not consistent in terms of the number of characters it takes up?
median_age
median_age_group1
median_age_group23
median_age_group23456
median_age_group234
...
Related Posts with How to get rid of unwanted characters based on a varying pattern?
Fixed effect, Random Effect, Lagged Dependent Variable, Robustness Check (Econometrics, Urgent!!) I am constructing an equation with yit = a + x1it + x2it + yit-1 + error term . In this case, wou…
z score as outcomeDear Stata users, I have two questions. Thanks in advance for your opinion. One: Is there a command…
Diagnostics for melogitI wonder if anyone can help me with the commands for diagnostics and model fitting for a multi level…
xtivreg postestimation commands for endogeneity, week instrument and over-identification testHi, I'm solving simultaneous equations with endogenous variable, hence choose 2sls. I've panel data…
cmogram problemDear StataList Users, I have attached a small and a relevant portion of my data. V010 stands for m…
Subscribe to:
Post Comments (Atom)
0 Response to How to get rid of unwanted characters based on a varying pattern?
Post a Comment