Learn R Programming

sprinter (version 1.1.0)

predict.sprinter: Predict method for objects of class sprinter

Description

Evaluates the linear predictor from a Cox proportional Hazards model fitted by sprinter.

Usage

## S3 method for class 'sprinter':
predict(object, newdata=NULL,\ldots)

Arguments

object
Cox proportional Hazards model from a sprinter call.
newdata
n.new * p matrix with new covariate values. If just prediction for the training data is wanted, it can be omitted.
...
additional arguments.

Value

  • The linear predictor, a vector of length n.new, is returned.

Examples

Run this code
simulation <- simul.int(287578,n = 200, p = 500,
                          beta.int = 1.0,
                          beta.main = 0.9, 
                          censparam = 1/20, 
                          lambda = 1/20)
data <- simulation$data    
simulation$info

set.seed(123)

testcb <- sprinter( x=data[,1:500],  
                    time = data$obs.time,
                    status= data$obs.status,
                    repetitions = 10,
                    mandatory = c("ID1","ID2"),
                    n.inter.candidates = 1000, 
                    screen.main = fit.CoxBoost, 
                    fit.final = fit.CoxBoost, 
                    args.screen.main = list(seed=123,stepno = 10, K = 10, 
                                            criterion ='pscore', nu = 0.05),
                    parallel = FALSE, trace=TRUE)
summary(testcb)


# true coefficients:
# Clin.cov1   Clin.cov2   ID5:ID6   ID7:ID8
# 0.9         -0.9        1         -1

# Simulate New Data:
newSimulation <- simul.int(12345,n = 200, p = 500,
                          beta.int = 1.0,
                          beta.main = 0.9, 
                          censparam = 1/20, 
                          lambda = 1/20)
newdata <- newSimulation$data    
newSimulation$info

predict(testcb, newdata = newdata[,1:500])

Run the code above in your browser using DataLab