Dear friends,
I need to fill in (duplicate the whole record) the missing days with the same record values as long as AE is the same value (i.e. "1"), once AE value changes, the process of duplication should proceed with the new AE value till it changes again. e.g. I need to fill in records: day 18-day 44, all the records are carried with the new AE value of "0". At the end for patient ID "1" we will end up with 73 records (for 73 days). ID DAY AE WT AGE RACE SEX TRT DOSE 1 1 1 72.12 45 1 2 2 8 1 9 1 72.12 45 1 2 2 8 1 10 1 72.12 45 1 2 2 8 1 11 1 72.12 45 1 2 2 8 1 17 0 72.12 45 1 2 2 8 1 45 1 72.12 45 1 2 2 8 1 46 1 72.12 45 1 2 2 8 1 47 1 72.12 45 1 2 2 8 1 53 1 72.12 45 1 2 2 8 1 54 3 72.12 45 1 2 2 8 1 73 1 72.12 45 1 2 2 8 I could not find much help ( R code) to accomplish this duplication. Thanks for your help. Ahmed [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.