Description Usage Arguments Value Examples
Add a new line to the dataframe with a censored time equal to 0 when the end of follow-up coincides to the last occurrence
1 | addCenTime(datin)
|
datin |
Dataframe containing id, time and event variables. Another covariates are allowed |
A data frame with an added line (censored time equal to 0) for those subjects where the end of follow-up coincides to the last occurrence
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | data(bladder, package="survival")
# we compute the interocurrence time
bladder2$time<-bladder2$stop-bladder2$start
# If we execute:
# gcmrec(Survr(id,time,event)~rx+size+number,data=bladder2,s=2060)
# We will obtain the following error message:
# Error in Survr(id, time, event) : Data doesn't match...
# This means that we have some patients without right-censoring time. So,
# we understand that the last event coincides with the end of study.
# Consequently,we need to add a line with time 0 and status value equal
# to 0, too. To do so, we can use the function "addCenTime" as follows:
# for example:
# bladder2[bladder2$id==12,]
# id rx number size start stop event enum time
# 45 12 1 1 1 0 3 1 1 3
# 46 12 1 1 1 3 16 1 2 13
# 47 12 1 1 1 16 23 1 3 7
# there is no censored time for 12th patient. So, if we execute
bladderOK<-addCenTime(bladder2)
# we would get
# id rx number size start stop event enum time
# 45 12 1 1 1 0 3 1 1 3
# 46 12 1 1 1 3 16 1 2 13
# 47 12 1 1 1 16 23 1 3 7
# 471 12 1 1 1 16 23 0 3 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.