Learn R Programming

GSSE (version 0.1)

test_stat: Kolmogorov-Smirnov Test Statistic

Description

This function is used to calculate the Kolmogorov-Smirnov statistic: $ D(F_1, F_2) = \sup_{x}|F_1(x) - F_2(x)| $.

Usage

test_stat (F1, F2)

Arguments

F1
vector of one distribution function value.
F2
vector of the other distribution function value.

Value

This function returns a list of prediction values for classes,
out
value of Kolmogorov-Smirnov statistics.

Details

It is necessary to point out that F1 and F2 are based on common grids. Other technical details can be found in Wang et al. (2015).

References

Wang, Y., Liang, B., Tong, X., Marder, K., Bressman, S., Orr-Urtreger, A., Giladi, N. & Zeng, D. (2015). Efficient estimation of nonparametric genetic risk function with censored data. Biometrika, 102(3), 515-532.

See Also

Permutation_Test()

Examples

Run this code

 X = seq(0.01, 1, 0.05);
 Func_1 = function(x){ x + runif(length(x), min=0, max=1) };
 Func_2 = function(x){ x + 2*runif(length(x), min=0, max=1) };
 
 U1 = Func_1(X);
 U2 = Func_2(X);
 
 test_stat (F1 = U1, F2 = U2);

Run the code above in your browser using DataLab