htna-named wrapper for Nestimate::bayes_compare(). The Bayesian
complement of permutation_htna(): instead of a permutation null, it
places a prior on the transition structure and returns the posterior
distribution of edge-weight differences between two networks.
Arguments
- x, y
The two networks to compare. See
Nestimate::bayes_compare().- ...
Additional arguments passed to
Nestimate::bayes_compare(), such asprior,draws,ci,mean_threshold,bound_threshold, andseed. See that function for the full, current argument list.
Value
An object of class net_bayes (also inheriting
netdifference and net_permutation). See
Nestimate::bayes_compare() for the full slot list.
Details
Works on htna networks: the actor partition ($node_groups,
$actor_levels, htna class) is preserved on result$x /
result$y, and the result carries class net_permutation, so
plot_htna_diff() can render it with htna's colour and layout
conventions — exactly like a permutation_htna() result.
Suffixed _htna to avoid clashing with the tna verb compare() and
to sit alongside permutation_htna() in the htna API.
See also
permutation_htna() for the permutation-test analogue,
plot_htna_diff() to plot the result.
Examples
# \donttest{
data(human_ai)
grp <- build_htna(human_ai, actor_type = "actor_type", group = "phase")
#> Warning: A network with one long sequence is not recommended and can't be validated using bootstrap and other confirmatory testings.
#> Metadata aggregated per session: ties resolved by first occurrence in 'cluster' (24 sessions), 'actor_type' (9 sessions)
#> Warning: A network with one long sequence is not recommended and can't be validated using bootstrap and other confirmatory testings.
#> Metadata aggregated per session: ties resolved by first occurrence in 'session_date' (1 sessions), 'cluster' (18 sessions), 'actor_type' (15 sessions)
# Pass the grouped network as it is; all pairwise comparisons are returned.
bayes_compare_htna(grp, draws = 200, seed = 1)
#> Grouped Bayesian Dirichlet-Multinomial Comparison
#> Comparisons: Late vs Early
#> Use summary() for combined edge-level results.
# }
