funsZnnself | R Documentation |
Two functions: Znnself.ct
and Znnself
.
Both functions are objects of class "cellhtest"
but with different arguments (see the parameter list below).
Each one performs hypothesis tests of equality of the expected values of the self entries (i.e., first column)
in a species correspondence contingency table (SCCT) or the expected values of the diagonal entries N_{ii}
in
an NNCT to the ones under RL or CSR.
That is, each performs NN self reflexivity for each class test which is appropriate
(i.e., have the appropriate asymptotic sampling distribution)
for completely mapped data.
NN self reflexivity is for each class can be viewed as a decomposition of species correspondence for
each class.
(See \insertCiteceyhan:NNCorrespond2018;textualnnspat for more detail).
Each test is based on the normal approximation of the self entries (i.e., first column) in a
species correspondence contingency table (SCCT) or the diagonal entries N_{ii}
in an NNCT and
are due to \insertCiteceyhan:NNCorrespond2018nnspat.
Each function yields a vector
of length k
of the test statistics, p
-values for the corresponding
alternative, null values (i.e., expected values), sample estimates (i.e., observed values) of self entries
in the SCCT or diagonal entries in the NNCT, a k \times 2
matrix of confidence intervals (where each row is the
confidence interval for self entry S_i
in the SCCT or diagonal entry N_{ii}
in the NNCT) and
also names of the test statistics, estimates, null values, the description of the test, and the data
set used.
The null hypothesis is that all E[S_i] = E[N_{ii}] = n_i(n_i - 1)/(n - 1)
where n_i
is the size of class i
and
n
is the data size.
The Znnself
functions (i.e., Znnself.ct
and Znnself
) are different from the Znnref
functions
(i.e., Znnref.ct
and Znnref
) and from Zself.ref
functions (i.e., Zself.ref.ct
and Zself.ref
) and also from
Znnself.sum
functions (i.e., Znnself.sum.ct
and Znnself.sum
).
Znnself
functions are testing the self reflexivity at a class-specific level (i.e., for each class) using the
first column in the SCCT, while Zself.ref
functions are for testing the self reflexivity for the entire data set
using entry (1,1)
in RCT, and Znnref
functions are for testing the self reflexivity and mixed non-reflexivity
using the diagonal entries in the RCT, and
Znnself.sum
functions are testing the cumulative species correspondence using the sum of the self column (i.e.,
the first column) in the SCCT.
Znnself.ct(
ct,
VarNii,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95
)
Znnself(
dat,
lab,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
...
)
ct |
The NNCT or SCCT, used in |
VarNii |
The variance vector of differences of self entries in the SCCT or diagonal entries in the NNCT,
used in |
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 |
Lower and Upper Confidence Levels, it is |
conf.int |
The |
cnf.lvl |
Level of the confidence intervals (i.e., conf.level) for the self entries in the SCCT or diagonal entries in the NNCT. |
estimate |
The |
est.name , est.name2 |
Names of the estimates, both are same in this function. |
null.value |
The |
null.name |
Name of the null values |
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
Zself.ref.ct
, Zself.ref
, Znnref.ct
,
Znnref
, Xsq.spec.cor
and Xsq.spec.cor.ct
n<-20
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.diag<-varNii.ct(ct,Qv,Rv)
Znnself(Y,cls)
Znnself(Y,cls,alt="g")
Znnself.ct(ct,VarN.diag)
Znnself.ct(ct,VarN.diag,alt="g")
Znnself(Y,cls,method="max")
ct<-scct(ipd,cls)
Znnself.ct(ct,VarN.diag)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)
Znnself(Y,fcls)
Znnself.ct(ct,VarN.diag)
#############
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.diag<-varNii.ct(ct,Qv,Rv)
Znnself(Y,cls,alt="l")
Znnself.ct(ct,VarN.diag)
Znnself.ct(ct,VarN.diag,alt="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.