Last chance! 50% off unlimited learning
Sale ends in
Two functions: Zseg.ind.ct
and Zseg.ind
.
Both functions are objects of class "cellhtest"
but with different arguments (see the parameter list below).
Each one performs hypothesis tests of deviations of
segregation indices from their expected values
under RL or CSR for each segregation index in the NNCT.
The test for each cell
Each function yields a contingency table of the test statistics,
The null hypothesis for each cell
See also (ceyhan:SiM-seg-ind2014;textualnnspat).
Zseg.ind.ct(
ct,
varN,
inf.corr = FALSE,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95
)Zseg.ind(
dat,
lab,
inf.corr = FALSE,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
...
)
A list
with the elements
The matrix
of test statistics
for the segregation indices
Name of the test statistics
The matrix
of
Matrix of lower and upper confidence levels for
the segregation indices at the given confidence
level conf.level
and depends on the type of alternative
.
Level of the upper
and lower confidence limits of the segregation indices,
provided in conf.level
.
Estimate of the parameter, i.e., matrix of the observed segregation indices
Names of the estimates, both are same in this function
Hypothesized values for the parameters, i.e., the null values of the segregation indices, which are all 0 under RL or CSR.
Name of the null value
Type of the alternative hypothesis in the test,
one of "two.sided"
, "less"
or "greater"
Description of the hypothesis test
Name of the contingency table, ct
,
returned by Zseg.ind.ct
only
Name of the data set, dat
,
returned by Zseg.ind
only
A nearest neighbor contingency table,
used in Zseg.ind.ct
only
The variance matrix for cell counts in the NNCT,
ct
; used in Zseg.ind.ct
only
A logical argument (default=FALSE
).
If TRUE
, indices are modified so that
they are finite and
if FALSE
the above definition in the description is used.
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 segregation indices
The data set in one or higher dimensions,
each row corresponds to a data point,
used in Zseg.ind
only
The vector
of class labels (numerical or categorical),
used in Zseg.ind
only
are for further arguments,
such as method
and p
,
passed to the dist
function,
used in Zseg.ind
only
Elvan Ceyhan
seg.ind
and Zseg.coeff
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
seg.ind(ct)
seg.ind(ct,inf.corr=TRUE)
W<-Wmat(ipd)
Qv<-Qvec(W)$q
Rv<-Rval(W)
varN<-var.nnct(ct,Qv,Rv)
varN
Zseg.ind(Y,cls)
Zseg.ind(Y,cls,inf.corr=TRUE)
Zseg.ind.ct(ct,varN)
Zseg.ind(Y,cls,alt="g")
Zseg.ind.ct(ct,varN,alt="g")
Zseg.ind(Y,cls,method="max")
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
Zseg.ind(Y,cls)
#############
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)
varN
Zseg.ind(Y,cls)
Zseg.ind(Y,cls,inf.corr = TRUE)
Zseg.ind.ct(ct,varN)
Zseg.ind.ct(ct,varN,inf.corr = TRUE)
#1D data points
n<-20 #or try sample(1:20,1)
X<-as.matrix(runif(n))# need to be entered as a matrix with one column
#(i.e., a column vector), hence X<-runif(n) would not work
ipd<-ipd.mat(X)
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)
Zseg.ind(X,cls)
Zseg.ind.ct(ct,varN)
Zseg.ind.ct(ct,varN,inf.corr=TRUE)
Run the code above in your browser using DataLab