nw <- network.initialize(n = 100, directed = FALSE)
nw <- set.vertex.attribute(nw, "race", value = rep(0:1, each = 50))
formation <- ~ edges + nodematch("race")
target.stats <- c(45, 25)
dissolution <- ~ offset(edges)
coef.diss <- dissolution.coefs(dissolution, duration = 20)
# Model estimation, then simulation
est <- epiNet.est(nw,
formation,
dissolution,
target.stats,
coef.diss,
save.stats = FALSE,
verbose = FALSE)
nwsims <- epiNet.simNet(est, nsteps = 100,
nsims = 1, verbose = FALSE)
# Extract edgelist from first simulation, then calculate censoring
el.sim1 <- as.data.frame(nwsims$nwsim1)
edgelist.censor(el.sim1)
Run the code above in your browser using DataLab