predict.rpst: Make predictions from a "rpst" object

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

Description

Similar to other predict methods, which returns predictions from a fitted "rpst" object.

Usage

1
2
## S3 method for class 'rpst'
predict(object, newdata,...)

Arguments

object

Output from the rpst function.

newdata

New data used for prediction.

...

additional summary arguments.

Value

predict.rpst returns a dataframe that contain a new column "class", which contains the class labels of each sample.

Author(s)

Yewei Li

References

Zhang, H., Legro, R. S., Zhang, J., Zhang, L., Chen, X., Huang, H., ... & Eisenberg, E. (2010). Decision trees for identifying predictors of treatment effectiveness in clinical trials and its application to ovulation in a study of women with polycystic ovary syndrome.. Human Reproduction, 25(10), 2612-2621.

See Also

print.rpst, predict.rpst, plot.rpst.

Examples

1
2
3
4
5
6
7
8
9
#require(survival)
##not run##
#data <- gen.data(n = 100, p = 10, c = 2)
#tree <- rpst(data$data, minsize = 2)
#class = predict.rpst(tree,data$data)$class

data <- gen.data(n = 20, p = 5, c = 2)
tree <- rpst(data$data, minsize = 2)
class = predict.rpst(tree,data$data)$class

Example output

Attaching package: 'rpst'

The following object is masked from 'package:stats':

    df

node), split,  n,  c(n1, n2),  c(avertime0,avertime1) 
+ denotes a nominal covariate
1 ) root 20 c(10, 10) c(0.76016616460591, 1.26561097401288) 
2 )  V1 <= 0.002856509 11 c(3, 8) c(1.35395649254437, 1.26561097401288) 
3 )  V1 > 0.002856509 9 c(7, 2) c(0.507644067816516, 0.89537129017265) 

rpst documentation built on May 2, 2019, 3:33 p.m.

Related to predict.rpst in rpst...