plot_compare: Plot the Difference Network Between Two Models

plot_compareR Documentation

Plot the Difference Network Between Two Models

Description

Plots the difference network between model x and model y. The edges are computed from subtracting the two models. The pie chart is the difference in initial probabilities between model x and model y. Green color indicates that x is greater than y and red indicates otherwise.

Usage

plot_compare(x, ...)

## S3 method for class 'tna'
plot_compare(x, y, posCol = "#009900", negCol = "red", ...)

Arguments

x

A tna object. This is the the principal model.

...

Additional arguments passed to cograph::splot().

y

A tna object. This is the model subtracted from the principal model.

posCol

Color for plotting edges and pie when the first group has a higher value. See cograph::splot().

negCol

Color for plotting edges and pie when the second group has a higher value. See cograph::splot().

Value

The difference network is drawn, and a list is returned invisibly with the elements weights (the matrix of edge weight differences x - y) and inits (the differences in the initial probabilities).

See Also

Model comparison functions compare(), compare.group_tna(), compare_sequences(), plot.tna_comparison(), plot.tna_sequence_comparison(), plot_compare.group_tna(), print.tna_comparison(), print.tna_sequence_comparison()

Examples

# Sequences that start with "plan" against the other sequences
model_x <- tna(subset(group_regulation, T1 == "plan"))
model_y <- tna(subset(group_regulation, T1 != "plan"))
plot_compare(model_x, model_y)


tna documentation built on Nov. 17, 2026, 1:06 a.m.