Hello. Please, could anyone help me?
I have the following variables: individual, year, month, day, date. It is not a panel. The date corresponds to when the person reported a flu. Some individuals are duplicated, ie., reported the flu more than once in the same year. So, I want to code that if they reported in consecutive months, then I consider the same case of flu, with double reporting, if they report in more than one month gap, then it is a different case and the person caught the flu more than once indeed.
Many thanks!
I have the following variables: individual, year, month, day, date. It is not a panel. The date corresponds to when the person reported a flu. Some individuals are duplicated, ie., reported the flu more than once in the same year. So, I want to code that if they reported in consecutive months, then I consider the same case of flu, with double reporting, if they report in more than one month gap, then it is a different case and the person caught the flu more than once indeed.
Many thanks!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2 id byte individual float(year month day) str10 date "1" 1 2000 12 2 "02/12/2000" "1" 1 2001 1 4 "04/01/2001" "2" 2 2001 3 12 "12/03/2001" "3" 3 2000 4 11 "11/04/2000" "3" 3 2002 1 29 "29/01/2002" "4" 4 2000 12 15 "15/12/2000" "4" 4 2000 1 9 "09/01/2000" "4" 4 2000 7 17 "17/07/2000" "5" 5 2002 1 13 "13/01/2002" "5" 5 2002 9 6 "06/09/2002" end
Comment