Learn R Programming

SNscan (version 1.0)

network.scan: Network Scan Statistic

Description

Evaluate scan statistics in social network.

Usage

network.scan(g, radius, attribute, model, pattern, max.prop = 0.5, xmin = NULL, zetatable = NULL)

Arguments

g
An igraph object.
radius
The radius of scanning windows. Default is 3.
attribute
The interested attribute which should be a data list including observations (obs) and populations (pop).
model
The distribution of attribute which can be "norm.stat", "pois.stat", "binom.stat", "multinom.stat", and "powerlaw.stat".
pattern
The testing pattern of the network which can be "structure", "attribute", and "both".
max.prop
Numeric value, the maximum proportion of selecting graph. Default is 0.5.
xmin
Numeric value, the minimum value only for powerlaw stat. Default is 1.
zetatable
Zatatable is applied when power-law distribution is used. Default is NULL.

Value

A matrix will be returned. The values include C: the center of a scanning window, D: The radius of a scanning window. test.L: the test statistic, S0: Indicating the testing information within the selected nodes. Sz: Indicating the testing information outside the nodes. The final column, z.length, is the number of the nodes in the cluster with corresponding center and radius.

See Also

network.mc.scan

Examples

Run this code
data(karate)

ks=network.scan(g=karate,radius=3,attribute=NULL,
	model="pois.stat",pattern="structure")	
mc.ks=network.mc.scan(n=9,g=karate,radius=3,attribute=NULL,
	model="pois.stat",pattern="structure")	
pv=mcpv.function(obs.stat=ks[,3],ms.stat=mc.ks[,3],direction=">=")

Run the code above in your browser using DataLab