funsZseg.coeff | R Documentation |
Two functions: Zseg.coeff.ct
and Zseg.coeff
.
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 coefficients from their expected values under RL or CSR for each segregation coefficient
in the NNCT.
The test for each cell i,j
is based on the normal approximation of the corresponding segregation coefficient.
That is, each performs the segregation coefficient tests which are appropriate
(i.e., have the appropriate asymptotic sampling distribution)
for completely mapped data.
The segregation coefficients in the multi-class case are the extension of Pielou's segregation coefficient
for the two-class case.
(See \insertCiteceyhan:SiM-seg-ind2014;textualnnspat for more detail).
Each function yields a contingency table of the test statistics, p
-values for the corresponding
alternative, lower and upper confidence levels, sample estimates (i.e., observed values) and null value
(i.e., expected value, which is 0) for the segregation coefficients
and also names of the test statistics, estimates, null value, the description of the test, and the data set used.
The null hypothesis for each cell i,j
is that the corresponding segregation coefficient equal to the expected value
(which is 0) under RL or CSR.
See also (\insertCiteceyhan:SiM-seg-ind2014;textualnnspat).
Zseg.coeff.ct(
ct,
VarSC,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95
)
Zseg.coeff(
dat,
lab,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
...
)
ct |
A nearest neighbor contingency table, used in |
VarSC |
The variance matrix for the segregation coefficients in the NNCT, |
alternative |
Type of the alternative hypothesis in the test, one of |
conf.level |
Level of the upper and lower confidence limits, default is |
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 |
stat.names |
Name of the test statistics |
p.value |
The |
LCL , UCL |
Matrix of lower and upper confidence levels for the segregation coefficients at the given
confidence level |
conf.int |
Confidence interval for segregation coefficients, it is |
cnf.lvl |
Level of the upper and lower confidence limits of the segregation coefficients,
provided in |
estimate |
Estimate of the parameter, i.e., matrix of the observed segregation coefficients |
est.name , est.name2 |
Names of the estimates, both are same in this function |
null.value |
Hypothesized null values for the parameters, i.e., expected values of the segregation coefficients, which are all 0 under RL or CSR. |
null.name |
Name of the null value |
alternative |
Type of the alternative hypothesis in the test, one of |
method |
Description of the hypothesis test |
ct.name |
Name of the contingency table, |
data.name |
Name of the data set, |
Elvan Ceyhan
seg.coeff
and Zseg.ind
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)
varT<-var.seg.coeff(ct,covN)
Zseg.coeff(Y,cls)
Zseg.coeff.ct(ct,varT)
Zseg.coeff(Y,cls,method="max")
Zseg.coeff(Y,cls,alt="g")
Zseg.coeff.ct(ct,varT,alt="g")
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)
Zseg.coeff.ct(ct,varT)
#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:4,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
ipd<-ipd.mat(Y)
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)
varT<-var.seg.coeff(ct,covN)
Zseg.coeff(Y,cls)
Zseg.coeff.ct(ct,varT)
Zseg.coeff(Y,cls,alt="g")
Zseg.coeff.ct(ct,varT,alt="g")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.