[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re:st: Handling string data
I have tried to solve this myself with the reference, but no luck so
far. My problem is to run a function on a string variable. This is
the data that I have
I was tring to generate a dummy variable y=1 when x3 is contained in X
and 0 otherwise. Is there a command to do this?
>>> There is a function you can use to do this.
gen byte y = strpos(X,"x3") > 0
In Stata 8 or earlier use -index()- not -strpos()-
* For searches and help try: