These functions calculate characteristics of the simulated networks.
Functions with _evo in their name calculate characteristics of the simulated networks by taking into account the starting network. For each specific dyad/triad it counts which and how many tie-changes have occured. In this way it is possible to get a feeling if twosteps were likely. These functions can also be used to assess whether the DGP of the observed data is likely to be the result of twosteps.
Usage
ts_dyads(sims, simtype = "notypespecified", forplot = TRUE)
ts_dyads_evo(sims, net1, simtype = "notypespecified", forplot = TRUE)
ts_triads(sims, simtype = "notypespecified", forplot = TRUE)
ts_triads_evo(sims, net1, simtype = "notypespecified", forplot = TRUE)
ts_nacf(sims, simtype = "notypespecified", forplot = TRUE, cov)
ts_degreecount(sims, mode = "out", simtype = "notypespecified", forplot = TRUE)
ts_rsienanets(ans)
Arguments
- sims
list, a list of (simulated) networks, the adjacency matrices representing the relations between actors. Valid values are 0 and 1. These simulated networks can be saved in objects that result from running
ts_sims()
,ts_estim()
orRSiena::siena07()
.- simtype
string, name of the simulation type used (e.g. ministep, twostep).
- forplot
logical, if set to
FALSE
a dataframe is returned with in the column the network characteristic and each row represents a simulation outcome. If set toTRUE
this dataframe is manipulated a bit, so that each row represents one specific network characteristic for each simulation outcome, this is useful for plotting.- net1
adjacency matrix, the adjacency matrix representing the relations between actors at Time=1. Valid values are 0 and 1.
- cov
numeric, covariate scores
- mode
Character string, “out” for out-degree, “in” for in-degree or “total” for the sum of the two. “all” is a synonym of “total”.
- ans
Results of class sienaFit, produced by a call to
RSiena::siena07()
Examples
if (FALSE) { # \dontrun{
results_ministep <- ts_sims(net=net1, rate=5, statistics=list(ts_degree, ts_recip),
parameters=c(-3,1))
results_twostep <- ts_sims(net=net1, rate=5, statistics=list(ts_degree, ts_recip),
parameters=c(-3,1), p2step=1)
dts_ms <- ts_dyads(sims=results_ministep, simtype="ministep")
dts_ts <- ts_dyads(sims=results_twostep, simtype="twostep")
df <- rbind(dts_ms, dts_ts)
p <- ggplot(df, aes(x=x, y=y, fill=type)) +
geom_violin(position=position_dodge(1)) +
stat_summary(fun = mean,
geom = "errorbar",
fun.max = function(x) mean(x) + sd(x),
fun.min = function(x) mean(x) - sd(x),
width=.1,
color="red", position=position_dodge(1)) +
stat_summary(fun = mean,
geom = "point",
color="red", position=position_dodge(1))
p
} # }