funsOnevsRest {nnspat} | R Documentation |
Functions for one versus rest type labeling
Description
Two functions: lab.onevsrest
and classirest
.
Both functions relabel the points,
keeping class i
label as is and
relabeling the other classes as "rest".
Used in the one-vs-rest type comparisons after
the overall segregation test is found to be significant.
See also (Ceyhan (2017)).
Usage
lab.onevsrest(i, lab)
classirest(i, lab)
Arguments
i |
label of the class that is to be retained in the post-hoc comparison. |
lab |
The |
Value
Both functions return the data relabeled
as class i
label is retained and the remaining is
relabeled as "rest".
Author(s)
Elvan Ceyhan
References
Ceyhan E (2017). “Cell-Specific and Post-hoc Spatial Clustering Tests Based on Nearest Neighbor Contingency Tables.” Journal of the Korean Statistical Society, 46(2), 219-245.
See Also
Examples
n<-20 #or try sample(1:20,1)
cls<-sample(1:2,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
lab.onevsrest(1,cls)
classirest(2,cls)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
lab.onevsrest("a",fcls)
lab.onevsrest("b",fcls)
classirest("b",fcls)
#cls as a factor
fcls<-rep(letters[1:4],rep(10,4))
lab.onevsrest("b",fcls)
classirest("b",fcls)
[Package nnspat version 0.1.2 Index]