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
OLS vs. Ordered Logistic RegressionHello, I have five employee-level variables as below, and I was wondering if I could use the OLS wi…
How to use If condition to restrict t test on only two groups with a categorical var that has 3 groupsHi Family, I have 1 categorical variable that has 3 grps( blue,yellow, green), I wanted check if the…
Make a list table in StataDear Stata users, Thank you in advance. I want to make a table that has all items listed in cells t…
Separating a character and a number part of a variableI have a variable consisting of characters and numbers in a string format. How can I separate the ch…
specifying stored coefficients in testI am running two multilevel models and storing the coefficients. I then want to test of the product …
Subscribe to:
Post Comments (Atom)
0 Response to Replace when a string variable is longer than 4 characters
Post a Comment