Calculate Network Target Statistics
calc_targets.Rd
Calculates network targets given, at minimum, a starting network, a list of parameters calculated from data, plus desired ERGM term and attribute. Function currently supports calculations for edges, nodefactor, nodematch, absdiff, and concurrent ERGM terms. Edges, nodefactor, and nodematch terms additionally require a joint distribution (default = age and race) of parameters for calculations, although these can be summed to output the marginal targets (e.g. nodefactor(~age))
Usage
calc_targets(
nw,
params,
rel,
count_type,
attr_name = NULL,
joint_attrs = c("age", "race"),
inst_correct = FALSE,
level = NULL,
attr_squared = FALSE,
time_unit = "weeks"
)
Arguments
- nw
the network object outputted from "generate_init_network" (usually already in environment during workflow)
- params
the parameter list object with parameters information for all networks estimated from data
- rel
string, which relationship/network sub-lists to pull parameters from.
- count_type
string, which ERGM term to generate targets for. Currently can only be in the form "edges", "nodefactor", "nodematch", "absdiff_sqrt_age", or "concurrent".
- attr_name
string of length 1, used for nodefactor and nodematch targets. If NULL, produces targets based on the two joint_attrs specifed
- joint_attrs
string of length 2, the two attrs used to calculate joint distribution of estimates calculated from empirical data
- inst_correct
default = FALSE, if TRUE, adjust year-long cumulative reporting of one-time partnerships to daily or weekly counts
- level
additional statification for nodedov target calculation function
- attr_squared
for nodecov target calculation, use squared version of attribute? (usually, age)
- time_unit
default = "weeks", the desired time unit for inst reporting conversion