Displaying 1 result from an estimated 1 matches for "date30".
Did you mean:
date3
2011 Nov 18
1
couting events by subject with "black out" windows
..., 1L)), .Names = c("ID", "Date","event"), class = "data.frame", row.names = c(NA, 14L))
## remove non events
data2 <- data1[data1$event==1,]
library(doBy)
## create a table of first events
step1 <- summaryBy(Date~ID, data = data2, FUN=min)
step1$Date30 <- step1$Date.min+30
step2 <- merge(data2, step1, by.x="ID", by.y="ID")
## use an ifelse to essentially remove any events that shouldn't be counted
step2$event <- ifelse(as.numeric(step2$Date) >= step2$Date.min & as.nu...