Learn R Programming

blockmodeling (version 0.1.9)

sedist: Computes distances in terms of Structural equivalence (Lorrain and White, 1971)

Description

The functions computed the distances in terms of Structural equivalence (Lorrain and White, 1971) between the units of a one-mode network. Several options for treating the diagonal values are supported.

Usage

sedist(M, method = "default", fun = "default",
   fun.on.rows = "default", handle.interaction = "switch",
   use = "pairwise.complete.obs", ...)

Arguments

M

A matrix representing the (usually valued) network. For now, only one-relational networks are supported. The network must be one-mode.

method

The method used to compute distances - any of the methods alloed by functions dist, cor or cov (all package::stats) or just "cor" or "cov" (given as character).

fun

Which function should be used to comput distacnes (given as character), .

fun.on.rows

For non-standard function - does the function compute measure on rows (such as cor, cov,...) of the data matrix (as opposed to computing measure on columns (such as dist).

handle.interaction

How should the interaction between the vertices analysed be handled: "switch" (the default) - assumes that when comparing units i and j, M[i,i] should be compared with M[j,j] and M[i,j] with M[j,i] "ignore" (diagonal) - Diagonal is ignored "none" - the matrix is used "as is"

use

For use with methods "cor" and "cov", for other methods (the default option should be used if handle.interaction=="ignore"), "pairwise.complete.obs" are always used, if stats.dist.cor.cov=TRUE

Additional arguments to fun

Value

A matrix (usually of class dist) is returned.

Details

If both method and fun are "default", the euclidian distances are computed. the "default" method for fun="dist" is "eucludian" and for fun="cor" "pearson".

References

Batagelj, V., Ferligoj, A., Doreian, P. (1992): Direct and indirect methods for structural equivalence. Social Networks 14, 63-90.

Lorrain, F., White, H.C., 1971. Structural equivalence of individuals in social networks. Journal of Mathematical Sociology 1, 49-80.

See Also

dist, hclust, REGE, crit.fun, opt.par, opt.random.par

Examples

Run this code
# NOT RUN {
#generating a simple network corresponding to the simple Sum of squares
#structural equivalence with blockmodel:
# null com
# null null
n<-20
net<-matrix(NA,ncol=n,nrow=n)
clu<-rep(1:2,times=c(5,15))
tclu<-table(clu)
net[clu==1,clu==1]<-rnorm(n=tclu[1]*tclu[1],mean=0,sd=1)
net[clu==1,clu==2]<-rnorm(n=tclu[1]*tclu[2],mean=4,sd=1)
net[clu==2,clu==1]<-rnorm(n=tclu[2]*tclu[1],mean=0,sd=1)
net[clu==2,clu==2]<-rnorm(n=tclu[2]*tclu[2],mean=0,sd=1)

D<-sedist(M=net)
plot.mat(net, clu=cutree(hclust(d=D,method="ward"),k=2))
# }

Run the code above in your browser using DataLab