survSL.template: Wrapper functions for prediction algorithms in...

View source: R/SL_wrappers.R

survSL.templateR Documentation

Wrapper functions for prediction algorithms in survSuperLearner

Description

This is a template function for a survSuperLearner prediction algorithm. You can use this to write your own prediction algorithms.

Usage

survSL.template(time, event, X, newX, new.times, obsWeights, id, ...)

Arguments

time

Observed follow-up time; i.e. minimum of the event and censoring times.

event

Observed event indicator; i.e, whether the follow-up time corresponds to an event or censoring.

X

Training covariate data.frame.

newX

Test covariate data.frame to use for prediction. Should have the same variable names and structure as X.

new.times

Times at which to obtain to obtain the predicted survivals.

obsWeights

Observation weights.

id

Observation clusters.

...

Additional ignored arguments.

Value

pred

Matrix of predictions, with the same number of rows as newX and number of columns equal to the length of new.times. Rows index new observations, and columns index new times at which the survival was computed.

fit

Elements of the model fit. Typically includes fit$object, the fitted object, but may include additional elements obtained in the fitting process that would be needed for prediction.


tedwestling/survSuperLearner documentation built on Dec. 12, 2024, 4:16 p.m.