[R] How to bootstrap one-sample ks.test?

Petar Milin pmilin at ff.ns.ac.yu
Sat Mar 18 01:55:42 CET 2006

I am testing if my data are distributed under Laplace's distribution,
which I managed to do with:
> library(rmutil)
> ks.test(jitter(x), "plaplace", mean(x), sd(x))

Nevertheless, I am trying to bootstrap ks.test without any success.
Something is wrong in my commands:
> data = read.table("data.dat",T)
> library(rmutil)
> library(boot)
> ks.laplace = function(d, w)
> 	ks.test(jitter(d), "plaplace", mean(d), sd(d))
> boot(data$x, ks.laplace, R = 5000)

I am getting error-message:
> Error: incorrect number of subscripts on matrix

Can anyone help me, since I have almost no experience with bootstrapping
techniques. I saw ks.boot() in Matching package, but it is for
two-samples, not for testing the shape of the distribution.

P. Milin

More information about the R-help mailing list