View source: R/NNCTFunctions.r
var.nnct | R Documentation |
Returns the variances of cell counts N_{ij} for i,j=1,…,k in the NNCT, ct
in matrix form which
is of the same dimension as ct
. These variances are valid under RL or conditional on Q and R under CSR.
See also (\insertCitedixon:1994,dixon:NNCTEco2002,ceyhan:eest-2010,ceyhan:jkss-posthoc-2017;textualnnspat).
var.nnct(ct, Q, R)
ct |
A nearest neighbor contingency table |
Q |
The number of shared NNs |
R |
The number of reflexive NNs (i.e., twice the number of reflexive NN pairs) |
A matrix
of same dimension as, ct
, whose entries are the variances of the cell counts
in the NNCT with class sizes given as the row sums of ct
. The row and column names are inherited from ct
.
Elvan Ceyhan
var.tct
, var.nnsym
and cov.nnct
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 W<-Wmat(ipd) Qv<-Qvec(W)$q Rv<-Rval(W) var.nnct(ct,Qv,Rv) #cls as a factor na<-floor(n/2); nb<-n-na fcls<-rep(c("a","b"),c(na,nb)) ct<-nnct(ipd,fcls) var.nnct(ct,Qv,Rv) ############# 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) var.nnct(ct,Qv,Rv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.