Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ecdf.ks.CI

Kolmogorov's Confidence Band


Description

Function to compute and plot Kolmogorov's 95% confidence band for the distribution function F(x). This code is adapted from the code by Kjetil Halvorsen found at: https://stat.ethz.ch/pipermail/r-help/2003-July/036643.html

Usage

ecdf.ks.CI(x, main = NULL, sub = NULL, xlab = deparse(substitute(x)), ...)

Arguments

x

a vector of data of length n

main

the title of the plot. The default is ecdf(x) + 95% K.S.Bands

sub

subtitle, as used in the function plot()

xlab

the label for the x-axis of the plot. The default is x.

...

any additional plotting options

Value

The function returns a list with three elements:

lower

the values of the lower part of the confidence band

upper

the values of the upper part of the confidence band

D

the value of Kolmogorov's D statistic

Note

This function also plots the confidence bands.

Author(s)

Rachel Becvarik

Examples

methyl<-c(42, 43, 51, 61, 66, 69, 71, 81, 82, 82)
ecdf.ks.CI(methyl)

ecdf.ks.CI(methyl, lwd=2, main="KS Confidence Bands")

NSM3

Functions and Datasets to Accompany Hollander, Wolfe, and Chicken - Nonparametric Statistical Methods, Third Edition

v1.16
GPL-2
Authors
Grant Schneider, Eric Chicken, Rachel Becvarik
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.