Hi all,

I have made a dataset containing variables like so: (sorry my dataex wont install properly!) cdeath=deathcode mdeath indicates death caused by tb - made this by using strpos if it includes 'tb' in description and correct code from cdeath.

Patid tdeath description deathdate __tbdeath(indicator)
1 ___A1 ____tb ______12/01/1996 __1
1 ___A3 ____non tb ___06/06/1995__ 0
1 ___A3 ____non tb____
2 ___A4
2___ A5
2 ___A6

I am trying to reduce the dataset to 1 row per person , and tb death should equal 1 if they have ANY malaria related death records and 0 if they had no malaria records.

Any help would be greatly appreciated!