Learn R Programming

kaps (version 0.9-3)

kaps: K-adaptive partitioing for survival data

Description

Conduct K-adaptive partitioning algorithm for censored survival data, especially with an application to SEER (Surveillance Epidemiology and End Results).

Usage

kaps(formula, data, K = 2:5, V = 5, mindat, ...)

Arguments

formula
an object with the type of Formula, with the response of the left hand side of the '~' operator, and the covariate terms on the right side. The response have be a survival object with survival time and censoring status by Surv. See
data
a dataset with variables used in Formula. It needs at least three variables including survival time, censoring status, and a covariate. The structure of this object is data.frame.
K
an object with the type of numeric to determine the number of subgroups.
V
an object with the type of numeric to determine the parameter V used in V-fold cross validation (CV). A default value is 5 (V=5).
mindat
an object with the type of numeric in order to set the minimum number of observations at each subgroup.
...
an object with the type of S4 class, "apssOptions", that provides several minors paramters. See apss.control.

Details

This function provides routines for K-adaptive partitioning algorithm.

References

Eo, SH, Hong, S-M and Cho, H (2012+). K-Adaptive Partitioning for Survival data with the application to SEER, in progression.

See Also

show, plot, predict, print and summary for the convenient use of kaps() apss.control to control kaps() more detail lrtree, lrtree.control for counterpart of kaps()

Examples

Run this code
data(toy)
f <- Surv(time, status) ~ meta
# Fit maps algorithm without cross validation.
# It means the step to finding optimal K is not entered.
#fit1 <- kaps(f, data = toy, K = 2:5, fold = FALSE)

# show the object of kaps (it contains apss S4 class)
#fit1

# summary of the object
#summary(fit1)
# If you want show another summary statistic for arbitrary K
#summary(fit1, K = 2) # It executes summary function of kaps with the result of K = 2.

# plot Kaplan-Meire survival curves
#plot(fit1)
#plot(fit1,K=3) # for K =2
# To conduct cross-validation, use V argument without fold input.
fit2 <- kaps(f, data = toy, K= 2:4, V=5) # It conduct kaps with V-fold cross-validation when V=5.
fit2

plot(fit2)
print(fit2,K=2)
summary(fit2)
summary(fit2,K=2)

## compare with other algorithms
#fit3 <- lrtree(f, data = toy, minbucket = 10)
#fit3
#par(mfrow = c(1,1))
#plot(fit3)

# require(party)
# fit4 <- ctree(f, data = toy)

Run the code above in your browser using DataLab