data(toy)
f <- Surv(time, status) ~ meta
# Fit kaps algorithm without cross-validation.
# It means the step to finding optimal K is not entered.
fit1 <- kaps(f, data = toy, K = 3)
# show the object of kaps (it contains apss S4 class)
fit1
# plot Kaplan-Meire estimates
plot(fit1)
# Fit kaps algorithm for selection optimal number of subgropus.
fit2 <- kaps(f, data = toy, K= 2:4)
fit2
# plot outputs with subgroup selection
require(locfit) # for scatterplot smoothing
plot(fit2)
print(fit2,K=2)
summary(fit2)
summary(fit2,K=2)
# require(party)
# fit4 <- ctree(f, data = toy)Run the code above in your browser using DataLab