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
🗎 Temporary file with -tempfile-Dear All, I am looking for a way to make use of temporary files with the putpdf image command. Unfo…
synth_runner's CIsHi everyone, Is there a way to graph confidence intervals when using synth_runner? (to put it around…
Restricting Loop to Observation NumberI wish to create a variable that looks something like 1994M1, 1994M2.....1994M12 to indicate the mon…
Summing across variables with conditionsHello, I am working with a data set where the variables represent questions from a survey that used…
Census data use of weights and survey-designHi! I am using Mexico 2010 census data to do an individual-level analysis. Upon reading the availa…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Code
Post a Comment