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
How do I drop dates later than 01.may 2013When I write: drop if=>01may2013 stata replices "01may2013 invalid name" …
Insufficient observations for fixed effects regression using xtsetHi, My Stata version is 13.1. I am trying some small scale fixed effects regression to test if my ma…
Reshape long to wide errorHello stateliest, Im having trouble trying to reshape my data set from long-wide. My code can be fou…
How do I drop dates => than 01.may 2013?When I write: drop if=>01may2013 stata replices "01may2013 invalid name" …
Finding the response rate to questionnaireDear Statalist, I have a survey data about the respondents' beverage intake information across mult…
Subscribe to:
Post Comments (Atom)
0 Response to generate dummy variable using strpos
Post a Comment