View source: R/NNCTFunctions.R
varPseg.coeff | R Documentation |
Returns the variance of Pielou's coefficient of segregation for the two-class case
(i.e., based on 2 \times 2
NNCTs)in a 2 \times 2
NNCT.
This variance is valid under RL or conditional on Q
and R
under CSR.
See also (\insertCiteceyhan:SiM-seg-ind2014;textualnnspat) for more detail.
varPseg.coeff(ct, covN)
ct |
A nearest neighbor contingency table |
covN |
The |
The variance of Pielou's coefficient of segregation for the two-class case.
Elvan Ceyhan
Pseg.coeff
, seg.coeff
and var.seg.coeff
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)
varPseg.coeff(ct,covN)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)
varPseg.coeff(ct,covN)
#############
ct<-matrix(sample(1:25,9),ncol=3)
#varPseg.coeff(ct,covN)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.