View source: R/preprocessing.R
insertLeftCensor | R Documentation |
Depreciated, use censoringData
.
Creates extra rows for indicating left-censored data.
insertLeftCensor(
dat,
nestVars,
timeVar,
all.values = F,
catVar,
catName = "(left censored)"
)
dat |
data.frame containing the variables to be lagged |
nestVars |
name(s) of the columns indicating how the data is nested
(e.g., ID variable). Currently up to two |
timeVar |
name of the column with the time variable. Only this variable
will be copied if |
all.values |
boolean if all values of the first row should be copied or only the time information (timeVar) |
catVar |
name of the event (for coxph or frailty) or event-type (for multi-state) column where the indication of the left-censoring is stored. |
catName |
character or numeric value to be written in |
data.frame with extra rows for left-censored data.
dat <- data.frame(ID = c(rep(1,10), rep(2,10)),
day = rep(c(rep(1,5), rep(2,5)),2),
a = runif(20, max = 10),
b = Sys.Date()+1:20,
cat = sample(c("X","Y","Z"), 20, replace = T))
insertLeftCensor(dat, nestVars = c("ID","day"),
timeVar = "b", catVar = "cat")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.