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
 wrapping up using lines of codes in a loopHi,
How can I wrap up the below code in a loop?
Best,
Nader
gen n=_n
gen sample=_n
replace sam… wrapping up using lines of codes in a loopHi,
How can I wrap up the below code in a loop?
Best,
Nader
gen n=_n
gen sample=_n
replace sam…
 Plot predictions after xthregHello Statalist,
I have experimental panel data und used xthreg to estimate a threshold function (w… Plot predictions after xthregHello Statalist,
I have experimental panel data und used xthreg to estimate a threshold function (w…
 ttest result and asdoc table not agree.Hi all,
I am getting problem with results in asdoc table, p-values in the Word file not agree with … ttest result and asdoc table not agree.Hi all,
I am getting problem with results in asdoc table, p-values in the Word file not agree with …
 Variables not working togetherHello,
I am relatively new to Stata and I am trying to run a regression and my whitedummy variable … Variables not working togetherHello,
I am relatively new to Stata and I am trying to run a regression and my whitedummy variable …
 installing an ado fileCan anyone guide me on how to install an ado file? I'm using stata 14.2 in Mac.
Here is the file htt… installing an ado fileCan anyone guide me on how to install an ado file? I'm using stata 14.2 in Mac.
Here is the file htt…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Code
Post a Comment