# EV.Nii: Expected Values of the Self Entries in a Species... In nnspat: Nearest Neighbor Methods for Spatial Patterns

 EV.Nii 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.

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

Elvan Ceyhan

### References

\insertAllCited

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

```

nnspat documentation built on Aug. 30, 2022, 9:06 a.m.