#To specify an exogenous effect (example: same)
cov <- data.frame(
actor = 1:10,
time = rep(0, 10),
gender = sample(c(0, 1), replace = TRUE, 10),
age = sample(20:30, 10, replace = TRUE)
)
effects <- ~ same(0.2, variable = "gender", attr_actors = cov)
#Rate Effects:
#If parameter is constant
rateEffects <- ~ outdegreeSender(0.3) +
send(0.1, variable = "age", attr_actors = cov)
#If parameter varies with time
rateEffects <- ~ outdegreeSender(param = function(t) exp(-t)) +
send(0.1, variable = "age", attr_actors = cov)
#Choice Effects:
#If parameter is constant
choiceEffects <- ~ inertia(0.4) +
reciprocity(-0.1) +
same(0.2, variable = "gender", attr_actors = cov) +
receive(0.1, variable = "age", attr_actors = cov)
#If parameter varies with time
choiceEffects <- ~ inertia(param = function(t) exp(-t)) +
reciprocity(-0.1) +
same(0.2, variable = "gender", attr_actors = cov) +
receive(0.1, variable = "age", attr_actors = cov)
Run the code above in your browser using DataLab