Learn R Programming

tsna (version 0.1.3)

tErgmStats: Calculate network summary statistics at multiple time points

Description

Applies a ergm-style formula of network statistics to cross-sectional networks collapsed from a networkDynamic at multiple time points to construct a matrix of values describing the change in statistics over time.

Usage

tErgmStats(nd, formula, start, end, time.interval = 1)

Arguments

nd
networkDynamic object to be evaluated
formula
a character string providing an ergm term name or the 'right hand side' of an ergm formula. For example '~ edges + concurrent'
start
optional numeric time value at which evaluation should start (default is first observed time)
end
optional numeric time value at which evaluation should end (default is last observed time)
time.interval
optional numeric value giving time interval between evaluations (default is 1)

Value

  • A time-series (ts) object containing term statistics in which each column corresponds to a statistic and each row is the time point at which the statistic was evaluated

Details

Constructs a set of times to evaluate based on start,end and time.interval. Extracts a static network at each time point and uses it to construct a formula with f. The formula is passed to ergm's summary.statistics.formula function to calculate the net value of the change statistics for each term in the formula. The values of the statistics are grouped into a time-series object (class ts). The ts object can be thought of as a matrix such that each column is a formula term and each row is the time point at which the statistics were evaluated. See ergm-terms for a list of available term statistics. Be aware that if the network's vertex activity dynamics imply cross-sectional networks of different sizes, the interpretation of the statistic at each time point may not be the same.

See Also

See also summary.statistics.formula and ergm-terms. For more information about time-series objects, see ts and plot.ts for plotting quickly plotting timelines for multiple statistics. The summary.statistics.networkDynamic function in the tergm package offers very similar functionality.

Examples

Run this code
data(windsurfers)
 tErgmStats(windsurfers,'~edges+degree(c(1,2))')
 library(networkDynamicData)
 data(concurrencyComparisonNets)
 tErgmStats(base,'~edges+concurrent',
               start=0,end=100,time.interval = 10)
 # show as multiple plots
 plot(
   tErgmStats(base,'~edges+concurrent',
                start=0,end=100,time.interval = 10),
                
                )

Run the code above in your browser using DataLab