data(grave)
# estimate and plot KD(r)
kd1 = kdest(grave, case = "affected")
plot(kd1, iso ~ r, ylab = "difference", legend = FALSE, main = "")
kd2 = kdest(grave, case = 2, nsim = 9, level = 0.8)
kd2 # print object
summary(kd2) # summarize distances KD(r) outside envelopes
plot(kd2)
# manually add legend
legend("bottomright", legend = c("obs", "avg", "max/min env", "95% env"),
lty = c(1, 2, 1, 2), col = c("black", "red", "darkgrey", "lightgrey"),
lwd = c(1, 1, 10, 10))
Run the code above in your browser using DataLab