Last chance! 50% off unlimited learning
Sale ends in
Two functions: Znnsym2cl.ss.ct
and Znnsym2cl.ss
.
Both functions are objects of class "htest"
but with different arguments (see the parameter list below).
Each one performs hypothesis tests of equality of the expected value of the off-diagonal
cell counts (i.e., entries) under RL or CSR in the NNCT for
Each symmetry test is based on the normal approximation of the difference of the off-diagonal entries in the NNCT and are due to pielou:1961;textualnnspat.
Each function yields the test statistic,
The null hypothesis is that
See also (pielou:1961,ceyhan:SWJ-spat-sym2014;textualnnspat) and the references therein.
Znnsym2cl.ss.ct(
ct,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95
)Znnsym2cl.ss(
dat,
lab,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
...
)
A list
with the elements
The
The
Confidence interval for the difference of the off-diagonal entries, conf.level
and depends on the type of alternative
.
Estimate, i.e., the difference of the off-diagonal entries of the
Hypothesized null value for the expected difference between the off-diagonal entries,
Type of the alternative hypothesis in the test, one of "two.sided"
, "less"
, "greater"
Description of the hypothesis test
Name of the data set, dat
, or name of the contingency table, ct
A nearest neighbor contingency table, used in Znnsym2cl.ss.ct
only
Type of the alternative hypothesis in the test, one of "two.sided"
, "less"
or "greater"
.
Level of the upper and lower confidence limits, default is 0.95
,
for the difference of the off-diagonal entries,
The data set in one or higher dimensions, each row corresponds to a data point,
used in Znnsym2cl.ss
only
The vector
of class labels (numerical or categorical), used in Znnsym2cl.ss
only
are for further arguments, such as method
and p
, passed to the dist
function.
used in Znnsym2cl.ss
only
Elvan Ceyhan
Xsq.nnsym.ss.ct
, Xsq.nnsym.ss
, Znnsym.ss.ct
and
Znnsym.ss
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
cls<-sample(1:2,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
ct<-nnct(ipd,cls)
ct
Znnsym2cl.ss(Y,cls)
Znnsym2cl.ss.ct(ct)
Znnsym2cl.ss(Y,cls,method="max")
Znnsym.ss.ct(ct)
Znnsym2cl.ss(Y,cls,alt="g")
Znnsym2cl.ss.ct(ct,alt="g")
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
Znnsym2cl.ss(Y,fcls)
#############
ct<-matrix(sample(1:20,4),ncol=2)
Znnsym2cl.ss.ct(ct) #gives an error message if ct<-matrix(sample(1:20,9),ncol=3)
Run the code above in your browser using DataLab