Description Usage Arguments Details Value Author(s) See Also Examples
This function permutes the "y" entries in an AcrossTic object and computes the cross-count statistic for each permutation. This generates a null distribution suitable for use in a permutation test.
1 | ptest(acobj, y, edge.weights, n = 1000)
|
acobj |
Object of class AcrossTic, output from |
y |
Character, factor or logical indicating class membership for each observation.
Normally this will be found inside |
edge.weights |
Vector of weights associated with each match. If omitted, the default is a vector of 1's of the proper length, unless the "acobj" object was computed with partial matching, in which case omitting edge.weights produces an error. |
n |
Integer, number of simulations. Default, 1000. |
This function permutes the y's n
times and computes the cross-count-match statistic.
If the observed value in the acobj
is generally smaller than the permuted values,
we conclude the distributions of the classes are different.
A list with class AcrossTicPtest and three components:
sims |
Vector of |
observed |
Observed cross-count statistic |
p.value |
P-value for test |
Sam Buttrey and Dave Ruth
1 2 3 4 5 6 | set.seed (123)
X <- matrix (rnorm (100), 50, 2) # Create data...
y <- rep (c ("One", "Two"), each=25) # ...and class membership
## Not run: ptest (rRegMatch (X, r = 3, y = y)) # p = .479
X[1:25,] <- X[1:25,] + 1
## Not run: ptest (rRegMatch (X, r = 3, y = y)) # p = .037
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.