edgelist_censor: Table of Edge Censoring

Description Usage Arguments Details Examples

View source: R/net.utils.R

Description

Outputs a table of the number and percent of edges that are left-censored, right-censored, both-censored, or uncensored for a networkDynamic object.

Usage

1

Arguments

el

Timed edgelist with start and end times extracted from a networkDynamic object using the as.data.frame.networkDynamic function.

Details

Given a STERGM simulation over a specified number of time steps, the edges within that simulation may be left-censored (started before the first step), right-censored (continued after the last step), right and left-censored, or uncensored. The amount of censoring will increase when the average edge duration approaches the length of the simulation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Initialize and parameterize network model
nw <- network_initialize(n = 100)
formation <- ~edges
target.stats <- 50
coef.diss <- dissolution_coefs(dissolution = ~offset(edges), duration = 20)

# Model estimation
est <- netest(nw, formation, target.stats, coef.diss, verbose = FALSE)

# Simulate the network and extract a timed edgelist
dx <- netdx(est, nsims = 1, nsteps = 100, keep.tedgelist = TRUE,
      verbose = FALSE)
el <- as.data.frame(dx)

# Calculate censoring
edgelist_censor(el)

EpiModel documentation built on Feb. 2, 2022, 9:06 a.m.