Learn R Programming

nnspat (version 0.1.2)

EV.Nii: 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:NNCorrespond2018;textualnnspat).

Usage

EV.Nii(ct)

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.

Arguments

ct

The NNCT or SCCT

Author

Elvan Ceyhan

References

See Also

scct and EV.nnct

Examples

Run this code
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)

Run the code above in your browser using DataLab