EV.Nii {nnspat}R Documentation

Expected Values of the Self Entries in a Species Correspondence Contingency Table (SCCT)

Description

Returns a vector of length k of 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. These expected values are valid under RL or CSR.

The argument ct can be either the NNCT or SCCT.

See also (Ceyhan (2018)).

Usage

EV.Nii(ct)

Arguments

ct

The NNCT or SCCT

Value

A vector of length k whose entries are the expected values of the self entries (i.e., first column) in a species correspondence contingency table (SCCT) or of the diagonal entries in an NNCT.

Author(s)

Elvan Ceyhan

References

Ceyhan E (2018). “A contingency table approach based on nearest neighbor relations for testing self and mixed correspondence.” SORT-Statistics and Operations Research Transactions, 42(2), 125-158.

See Also

scct and EV.nnct

Examples

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

EV.Nii(ct)
ct<-scct(ipd,cls)
EV.Nii(ct)

#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)

EV.Nii(ct)

#############
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)

EV.Nii(ct)
ct<-scct(ipd,cls)
EV.Nii(ct)


[Package nnspat version 0.1.2 Index]