cug.test: Univariate Conditional Uniform Graph Tests

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/gtest.R

Description

cug.test takes an input network and conducts a conditional uniform graph (CUG) test of the statistic in FUN, using the conditioning statistics in cmode. The resulting test object has custom print and plot methods.

Usage

1
2
3
cug.test(dat, FUN, mode = c("digraph", "graph"), cmode = c("size", 
    "edges", "dyad.census"), diag = FALSE, reps = 1000, 
    ignore.eval = TRUE, FUN.args = list())

Arguments

dat

one or more input graphs.

FUN

the function generating the test statistic; note that this must take a graph as its first argument, and return a single numerical value.

mode

graph if dat is an undirected graph, else digraph.

cmode

string indicating the type of conditioning to be applied.

diag

logical; should self-ties be treated as valid data?

reps

number of Monte Carlo replications to use.

ignore.eval

logical; should edge values be ignored? (Note: TRUE is usually more efficient.)

FUN.args

a list containing any additional arguments to FUN.

Details

cug.test is an improved version of cugtest, for use only with univariate CUG hypotheses. Depending on cmode, conditioning on the realized size, edge count (or exact edge value distribution), or dyad census (or dyad value distribution) can be selected. Edges are treated as unvalued unless ignore.eval=FALSE; since the latter setting is less efficient for sparse graphs, it should be used only when necessary.

A brief summary of the theory and goals of conditional uniform graph testing can be found in the reference below. See also cugtest for a somewhat informal description.

Value

An object of class cug.test.

Author(s)

Carter T. Butts [email protected]

References

Butts, Carter T. (2008). “Social Networks: A Methodological Introduction.” Asian Journal of Social Psychology, 11(1), 13–41.

See Also

cugtest

Examples

1
2
3
4
5
6
7
#Draw a highly reciprocal network
g<-rguman(1,15,mut=0.25,asym=0.05,null=0.7)

#Test transitivity against size, density, and the dyad census
cug.test(g,gtrans,cmode="size")
cug.test(g,gtrans,cmode="edges")
cug.test(g,gtrans,cmode="dyad.census")

Example output

Loading required package: statnet.common

Attaching package: 'statnet.common'

The following object is masked from 'package:base':

    order

Loading required package: network
network: Classes for Relational Data
Version 1.13.0 created on 2015-08-31.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.4 created on 2016-07-23.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.


Univariate Conditional Uniform Graph Test

Conditioning Method: size 
Graph Type: digraph 
Diagonal Used: FALSE 
Replications: 1000 

Observed Value: 0.2625 
Pr(X>=Obs): 1 
Pr(X<=Obs): 0 


Univariate Conditional Uniform Graph Test

Conditioning Method: edges 
Graph Type: digraph 
Diagonal Used: FALSE 
Replications: 1000 

Observed Value: 0.2625 
Pr(X>=Obs): 0.351 
Pr(X<=Obs): 0.649 


Univariate Conditional Uniform Graph Test

Conditioning Method: dyad.census 
Graph Type: digraph 
Diagonal Used: FALSE 
Replications: 1000 

Observed Value: 0.2625 
Pr(X>=Obs): 0.383 
Pr(X<=Obs): 0.619 

sna documentation built on May 30, 2017, 12:18 a.m.

Related to cug.test in sna...