Displaying 1 result from an estimated 1 matches for "casetim".
Did you mean:
casetime
2008 Jul 01
0
cohort sampling
...ntrol at time t.
Here is some sample code, I am sure that others can do better. Assume
variables 'time' = follow-up time for each subject, status = 1 if there was an
event at the last follow-up, and x1, x2 are covariates. Assume time>0 for all
subjects.
n <- length(time)
casetime <- unique(time[status==1]) # all the event times
chosen <- rep(0,n) # marks the case and control groups
for (i in casetime) {
cases <- (time==i & status==1)
potential <- (1:n)[!cases & chosen==0 & time >=i] #potential controls
new.co...