statistics - What's the lowest number R will present before rounding to 0? -
i'm doing statistical analysis r software (bootstrapped kolmogorov-smirnov tests) of large data sets, meaning p values incredibly small. i've bonferroni corrected large number of tests i've performed meaning alpha value small in order reject null hypothesis.
the problem is, r presents me p values of 0 in cases p value presumably small cannot presented (these large sample sizes). while can happily reject null hypothesis these tests, data publication, i'll need write p < ..... don't know lowest reportable values in r are?
i'm using ks.boot function in case matters.
any appreciated!
.machine$double.xmin gives smallest non-zero normalized floating-point number. on systems that's 2.225074e-308. however, don't believe sensible limit.
instead suggest in matching::ks.boot change line
ks.boot.pval <- bbcount/nboots
ks.boot.pval <- log(bbcount)-log(nboots) , work on log-scale.
edit:
you can use trace modify function.
step 1: @ function body, find out add additional code.
as.list(body(ks.boot)) you'll see element 17 ks.boot.pval <- bbcount/nboots, need add modified code directly after that.
step 2: trace function.
trace (ks.boot, quote(ks.boot.pval <- log(bbcount)-log(nboots)), at=18) step 3: can use ks.boot , return logarithm of bootstrap p-value ks.boot.pvalue. note cannot use summary.ks.boot since calls format.pval, not show negative values.
step 4: use untrace(ks.boot) remove modifications.
Comments
Post a Comment