survSL.gam: Wrapper function for generalized additive Cox regression...

View source: R/SL_wrappers.R

survSL.gamR Documentation

Wrapper function for generalized additive Cox regression prediction algorithm

Description

This prediciton algorithm uses the gam function from the mgcv package to estimate a generalized additive Cox proportional hazards regression model. This model generalizes the usual Cox proportional hazards model to allow for an additive combination of smooth and possibly non-linear functions of the continuous covariates.

Usage

survSL.gam(time, event, X, newX, new.times, cts.num = 5, ...)

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.

cts.num

The lower cutoff of unique values at which a covariate should be treated as continuous. Any covariate with number of unique values strictly larger than cts.num will be treated as continuous and receive a smooth term in the GAM. If X contains unordered factors with large numbers of unique values, cts.num should be set to larger than these numbers of unique values, otherwise an error may be thrown.

...

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

One-element list including object, the fitted gam. object.


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