Dear all,
I would like to replace a string variable which is longer than 4 digits with numbers. For example, if variable A has "swimming", "karate", "kickboxing", "basketball" then I want to change them into number 4 as they are longer than 4 characters. But not for "car" as it is shorter than 4.
Many thanks in advance. Kim
Related Posts with Replace when a string variable is longer than 4 characters
cnsreg using i.variables produces different results from self generated dummiesI have a dependent variable y, and the regressors are age, year and cohort (birth year). birth year …
Problem grouping hierarchical data into subset of the dataHello I am new to Stata and I am struggling to find the best command /code to the below data. I am …
Panel data logistic regression (xtlogit): Choosing between fixed effects and random effectsHI Helpful List, I have panel data on ~2000 companies between 2005 and 2010. Of these 2000 companie…
Getting rid of na observablesHi, How do I get rid of na and scotsup,ms observables please? Array …
Recode helpHi, I am trying to get three variables only i.e. England, Wales and Scotland. I want to recode 'n…
Subscribe to:
Post Comments (Atom)
0 Response to Replace when a string variable is longer than 4 characters
Post a Comment