Hey Stata Community,
I'm looking for a way to generate a variable depending on the "4 last letters" of another variable.
Example:
My variable has car names like "VW" or "AUDI", but sometimes the variable also says "VW FGDT" (4 random letters behind the car name, no model specifications).
How can I generate a new variable that is "1" if there is this random 4 letter code behind the car name? Is there something like a "placeholder" I can use for these random 4 letters?
Best regards,
Milena
Related Posts with Stata Code
Difference between the two options under model two tab for three stage least squares?In stata after going to statistics-->endogenous covariates ---> Three stage least squares and …
how to use regexm to analyse string variablesDear All Can anyone help me in finding an easier way to categories open ended questions. an examp…
Sample size calculation using one sided test with power commandHello all, I am trying to run a test to determine the sample size where the outcome is proportions …
Creating summary statistic tables with multiple variables with multiple super-columns.Hi all, I am trying to replicate the results of a paper, and I am having trouble creating nicely fo…
Cut name variable into two variables to get casteHello I am trying to segregate the name variable into two separate name and caste variables. (The s…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Code
Post a Comment