Description Usage Arguments Examples
This function assumes time starts at 1 and counts unit increments.
1 2 3 | buildQuasiObsForTraining(d, numberOfObservations, eventIndex, idColumnName,
indexColumnName, eventColumnName, parallelCluster = NULL, targetSize = NA,
forceEvent = FALSE, weightsColumnName = NULL)
|
d |
data.frame to expand |
numberOfObservations |
vector (entries >=1) for each row of d up to what step number did we observe |
eventIndex |
vector for each row of d at what time did event occur. Event i is considered censored if eventIndex[[i]] is NA or out of range of 1:numberOfObservations. |
idColumnName |
character scalar, column to write original row ids in |
indexColumnName |
character scalar, column to write quasi event indices into |
eventColumnName |
character scalar, column to write quasi events indicator into. If NA, write no such column. |
parallelCluster, |
if not NULL parallel cluster to perform the work. |
targetSize |
numeric scalar, if not NA target size for a uniform sample of the quasi observations. This should be a very large number. |
forceEvent |
logical scalar, if true force conversion events into sample |
weightsColumnName |
if not NULL column to write sampling weights in |
1 2 3 | d <- data.frame(lifetime=c(2,1,2),censored=c(FALSE,FALSE,TRUE))
buildQuasiObsForTraining(d,d$lifetime,ifelse(d$censored,NA,d$lifetime),
'origRow','sampleAge','deathEvent')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.