Hi, I have created a string (pattern) variable containing 0 and 1. For example, a string pattern 0000000011 means the person appears in 10 years of survey where she has '0' response in first eight years and '1' response in last two years.  From this string pattern, now I want to detect who has at least two consecutive 1 response in any years, that means I want to locate *11* pattern in any parts of the string irrespective of the value of *.  Please help if anybody is familiar with the STATA code.

More Ujjwal Kumar Das's questions See All
Similar questions and discussions