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?
Warning strata using hotdeck commandHello, I am imputing data using hotdeck command. Just so you may know exactly how I am doing this, …
het() option - Which variables do I have to include?Hello, I am dealing with an intreg model, which does not meet the assumption of homoskedasticity. I…
Meta-analysis of prevalence data using metaprop commandHi There, I am seeking some help regarding the meta-analysis of the prevalence data using the metap…
Related to Variable transformation & ScalingAdvance sorry for asking such a naive doubt in Stata. I have 2 variables, 1.cash holdings and 2.tota…
Extracting Parts of a Sting variable: Numerous Attempts failedHello, I've spent the last 3 hours trying to extract various parts of this string variable <mcas…
Subscribe to:
Post Comments (Atom)
0 Response to How to get rid of unwanted characters based on a varying pattern?
Post a Comment