Allows the user to add its own pre-computed statistic to the statistics object and, optionally, interact this statistic with other statistics in the formula.
Examples
# \donttest{
reh <- remify::remify(history, model = "tie")
actor101Events <- which(history$actor1 == "101" | history$actor2 == "101")
actor101_stat <- t(sapply(seq_len(nrow(history)), function(i) {
rep(i %in% actor101Events, reh$D)
}))
# Main effects only
effects <- ~ userStat(x = actor101_stat, variableName = "actor101event")
remstats(reh = reh, tie_effects = effects)
#> Error in eval(y): object 'actor101_stat' not found
# Model with interaction effects
interaction_effects <- ~ inertia() *
userStat(x = actor101_stat, variableName = "actor101event")
remstats(reh = reh, tie_effects = interaction_effects)
#> Error in eval(y): object 'actor101_stat' not found
# }