funsXsq.nnsym.dx | R Documentation |
Two functions: Xsq.nnsym.dx.ct
and Xsq.nnsym.dx
.
Both functions are objects of class "Chisqtest"
but with different arguments (see the parameter list below).
Each one performs the hypothesis test of equality of the expected value of the off-diagonal
cell counts (i.e., entries) under RL or CSR in the NNCT for k \ge 2
classes.
That is, each performs Dixon's overall NN symmetry test.
The test is appropriate (i.e., have the appropriate asymptotic sampling distribution)
for completely mapped data.
(See \insertCiteceyhan:SWJ-spat-sym2014;textualnnspat for more detail).
Each symmetry test is based on the chi-squared approximation of the corresponding quadratic form and is an extension of Dixon's NN symmetry test, which is extended by \insertCiteceyhan:SWJ-spat-sym2014;textualnnspat.
Each function yields the test statistic, p
-value and df
which is k(k-1)/2
, description of the
alternative with the corresponding null values (i.e., expected values) of differences of the off-diagonal entries,(which is
0 for this function) and also the sample estimates (i.e., observed values) of absolute differences of the off-diagonal entries of
NNCT (in the upper-triangular form).
The functions also provide names of the test statistics, the description of the test and the data set used.
The null hypothesis is that all E(N_{ij})=E(N_{ji})
entries for all i \ne j
(i.e., symmetry in the
mixed NN structure).
See also (\insertCiteceyhan:SWJ-spat-sym2014;textualnnspat) and the references therein.
Xsq.nnsym.dx.ct(ct, covS)
Xsq.nnsym.dx(dat, lab, ...)
ct |
A nearest neighbor contingency table, used in |
covS |
The |
dat |
The data set in one or higher dimensions, each row corresponds to a data point,
used in |
lab |
The |
... |
are for further arguments, such as |
A list
with the elements
statistic |
The chi-squared test statistic for Dixon's overall NN symmetry test |
stat.names |
Name of the test statistic |
p.value |
The |
df |
Degrees of freedom for the chi-squared test, which is |
estimate |
Estimates, i.e., absolute differences of the off-diagonal entries of NNCT (in the upper-triangular form). |
est.name , est.name2 |
Names of the estimates, former is a shorter description of the estimates than the latter. |
null.value |
Hypothesized null values for the differences between the expected values of the off-diagonal entries, which is 0 for this function. |
method |
Description of the hypothesis test |
ct.name |
Name of the contingency table, |
data.name |
Name of the data set, |
Elvan Ceyhan
Znnsym.dx.ct
, Znnsym.dx
, Znnsym
,
Xsq.nnsym
, Xsq.nnsym.ss.ct
, Xsq.nnsym.ss
and Qsym.test
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)
W<-Wmat(ipd)
Qv<-Qvec(W)$q
Rv<-Rval(W)
varN<-var.nnct(ct,Qv,Rv)
covN<-cov.nnct(ct,varN,Qv,Rv) #default is byrow
covS<-cov.nnsym(covN)
Xsq.nnsym.dx(Y,cls)
Xsq.nnsym.dx.ct(ct,covS)
Xsq.nnsym.dx(Y,cls,method="max")
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)
Xsq.nnsym.dx(Y,fcls)
Xsq.nnsym.dx.ct(ct,covS)
#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
cls<-sample(1:4,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
ct<-nnct(ipd,cls)
W<-Wmat(ipd)
Qv<-Qvec(W)$q
Rv<-Rval(W)
varN<-var.nnct(ct,Qv,Rv)
covN<-cov.nnct(ct,varN,Qv,Rv)
covS<-cov.nnsym(covN)
Xsq.nnsym.dx(Y,cls)
Xsq.nnsym.dx.ct(ct,covS)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.