compare_to_baseline {motifr}R Documentation

Compare motif occurence in empirical network to occurence in a baseline model

Description

This function plots a comparison of the motif counts in a given network with the motif counts in a baseline model.

Usage

compare_to_baseline(
  net,
  motifs,
  n = 10,
  lvl_attr = "sesType",
  assume_sparse = TRUE,
  model = "erdos_renyi",
  level = -1,
  ergm_model = NULL,
  directed = NULL
)

Arguments

net

network object

motifs

list of motif identifier strings

n

number of random graphs used in baseline model

lvl_attr

character vector specifying the attribute name where level information is stored in net.

assume_sparse

whether the random graphs shall be assumed to be sparse. used to find ideal counting function

model

baseline model to be used. Options are 'erdos_renyi', 'actors_choice', 'ergm', 'partial_ergm' and fixed_densities'. See vignette("random_baselines") for more details. Defaults to 'erdos_renyi'.

level

lvl_attr of the variable level for the Actor's Choice model

ergm_model

ergm model as for example fitted by calling ergm::ergm() on the empirically observed network. Needs to be supplied when model is set to ergm.

directed

whether the graph shall be treated as a directed graph. Per default (NULL), this is determined automatically using the structure of the provided network object

Details

Note that when using the Actor's Choice model this function does not choose the variable level automatically. Use the level parameter to provide a valid level.

When using ERGM the parameter net is not used. Networks to create the baseline from are sampled in R using the ergm_model parameter.

Value

data frame with one row for each motif identifier string and one row for every computed random graph

Examples

## Not run: 
compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)

## End(Not run)

[Package motifr version 1.0.0 Index]