Hi everyone!
I have searched this forum and read the official stata help section, but I'm still not able to do what I want to do so I hope anyone here can help me.
My dataset consists of several variables of someones occupations in their professional career, measured at three points in time (each point in time equals one variable).
Now, for each variable there exist multiple occupations (entrepreneur, serial entrepreneur, investor, etc.) that can occur simultaneously.
An example occupation for one point in time might be "Entrepreneur" while for another observation it is "Investor, Serial Entrepreneur".
Now, I want to create a dummy variable "SubsequentEntrepreneur" that equals 1 if in any of these three strings contains the word "Entrepreneur" (or "Serial Entrepreneur") and 0 if it does not contain the phrase "Entrepreneur".
I think I need to use "strpos" but I have difficulties to connect the three variables (points in time). Maybe anyone has a suggestion?
I would be very grateful for any help!
Thank you very much,
Chris
Related Posts with generate dummy variable using strpos
duration of employment spells by personal idHi! I would like to calculate duration of low wage employment (dummy 0/1) for each individual in my…
option measure() not allowed r(198)Hi, I am a newbie to using Stata and Meta-analysis. When I entered "metabias logor selogor, begg" or…
Including additional interaction fixed effects in a two way fixed effect modelHi Statalist, I just joined the community and I would like to ask a question that I couldn’t solve …
Tabulating or listing distinct values for multiple variablesHi, I want to tabulate or list the distinct or unique values of "stcode" and "avg" variables. The d…
Does "reverse" retain as official word?Dear Stata users, I installed a community contributed command -revrs- (SSC) written by Kyle Longest…
Subscribe to:
Post Comments (Atom)
0 Response to generate dummy variable using strpos
Post a Comment