require(OutlierDC)
# Toy example
data(ebd)
# The data consists of 402 observations with 6 variables.
dim(ebd)
# To show the first six observations of the dataset,
head(ebd)
#scoring algorithm
fit <- odc(Surv(log(time), status) ~ meta, data = ebd)
fit
coef(fit)
plot(fit)
# Add upper bound for the selection of outleirs
fit1 <- update(fit, k_s = 4)
fit1
plot(fit1)
# residual-based algorithm
fit2 <- odc(Surv(log(time), status) ~ meta, data = ebd, method = "residual", k_r = 1.5)
fit2
plot(fit2)
# To display all of outlying observations in the fitted object
fit2@outlier.data
# boxplot algorithm
fit3 <- odc(Surv(log(time), status) ~ meta, data = ebd, method = "boxplot", k_b = 1.5)
fit3
plot(fit3, ylab = "log survival times", xlab = "metastasis lymph nodes")
Run the code above in your browser using DataLab