predict.rrotsfspls: rotsf predict.rrotsfspls

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/predict.rrotsfspls.R

Description

Prediction with rrotsfspls and return a list of with mean hazard function

Usage

1
2
## S3 method for class 'rrotsfspls'
predict(object, testx, trlength = object$trlength, ...)

Arguments

object

An object that inherits from class rrotsfspls.

testx

A data frame in which to look for variables with which to predict.

trlength

Number of based models used for prediction, shouble be less than and equal to the number for training.

...

Additional arguments.

Value

produces a vector of predictions or a matrix of predictions

Author(s)

Hong Wang and Lifeng Zhou

References

See Also

pec R package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(123)
require(rotsf)
require(survival)
## Survival Forest with PLS  with default settings
#Lung DATA
data(lung)
lung=na.omit(lung)
lung[,3]=lung[,3]-1
n=dim(lung)[1]
L=sample(1:n,ceiling(n*0.5))
trset<-lung[L,]
teset<-lung[-L,]
rii=c(2,3)
plssurvmodel=rrotsfspls(x=trset[,-rii],y=Surv(trset[,rii[1]], trset[,rii[2]]))
mypre=predict(plssurvmodel, teset[,-rii])

whcsu/rotsf documentation built on Dec. 4, 2019, 2:10 p.m.