Learn R Programming

tna (version 1.2.0)

compare.group_tna: Compare Grouped TNA Models with Comprehensive Metrics

Description

Compare Grouped TNA Models with Comprehensive Metrics

Usage

# S3 method for group_tna
compare(
  x,
  i = 1L,
  j = 2L,
  scaling = "none",
  measures = character(0),
  network = TRUE,
  ...
)

Value

A tna_comparison object. See compare.tna() for details.

Arguments

x

A group_tna object.

i

An integer index or the name of the principal cluster as a character string.

j

An integer index or the name of the secondary cluster as a character string.

scaling

A character string naming a scaling method to apply to the weights before comparing them. The supported options are:

  • "none": No scaling is performed. The weights are used as is.

  • "minmax": Performs min-max normalization, i.e., the minimum value is subtracted and the differences are scaled by the range.

  • "max": Max-normalization: the values are divided by the maximum value.

  • "rank": Applies min-max normalization to the ranks of the weights (computed with ties.method = "average").

  • "zscore": Computes the standard score, i.e. the mean weight is subtracted and the differences are scaled by the standard deviation.

  • "robust": Computes the robust z-score, i.e. the median weight is subtracted and the differences are scaled by the median absolute deviation (using stats::mad).

  • "log": Simply the natural logarithm of the weights.

  • "log1p": As above, but adds 1 to the values before taking the logarithm. Useful for scenarios with zero weights.

  • "softmax": Performs softmax normalization.

  • "quantile": Uses the empirical quantiles of the weights via stats::ecdf.

measures

A character vector indicating which centrality measures should be computed. See centralities() for the available measures. No measures are included by default.

network

A logical value indicating whether network metrics should be included in the comparison. The default is TRUE.

...

Additional arguments passed to compare.tna().

See Also

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

Examples

Run this code
model <- group_model(engagement_mmm)
compare(model, i = 1, j = 2)

Run the code above in your browser using DataLab