ks2d1p | R Documentation |
A permutation test to compute a p-value for the D test statistic for the one-sample two-dimensional Kolmogrov-Smirnov test.
ks2d1p(object, B = 100) ## S3 method for class 'ks2d1p' print(x, ...) ## S3 method for class 'ks2d1p' plot(x, xlab = "D Test Statistic", main = "", ...)
object |
An object returned from |
B |
A numeric representing the number of resamples. |
x |
An object returned from |
... |
Additional arguments sent to the plot function. |
xlab |
A string to label the x-axis. |
main |
A string to label the main title on the plot. |
NEED DETAIL HERE.
The main function returns a list with the following items:
D The D test statistic from the ks2d2
object.
pval The p-value from the permutation test. See details.
Ds The D test statistics from each of the B ‘resamples’.
B The B
value supplied by the user.
The plot
function returns a density plot of the D test statistics from each of the B ‘resamples’ with the observed D test statistic shown with a vertical line. The print
function prints the results in a nice format).
This function is experimental at best at this point.
Derek H. Ogle, dogle@northland.edu, with significant help from Ben Bolker.
Garvey, J.E., E.A. Marschall, and R.A. Wright. 1998. From star charts to stoneflies: detecting relationships in continuous bivariate data. Ecology 79:442 447.
Press, W.H., S.A. Teukolsky, W.T. Vetterling, B.P. Flannery. 2007. Numerical Recipes: The Art of Scientific Computing, 3rd Edition. Cambridge University Press. 1286 pages.
ks2d1
data(Garvey4a) # Results from the main 1-sample 2-D KS test from ks2d1 ( res1 <- with(Garvey4a,ks2d1(shad,sunfish)) ) plot(res1,xlab="Shad Densitiy",ylab="Sunfish Density") # permutation test using resampling ( res1p <- ks2d1p(res1,B=10) ) # B should be >1000, used 10 here to save time plot(res1p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.