Skip to content

Discrepancy Analysis: Sequenzo and TraMineR Mapping

This page maps Sequenzo discrepancy-analysis functions to their closest TraMineR counterparts. The R names below are taken from TraMineR core (dissassoc, dissvar, disstree, seqtree, seqdiff, and related helpers).

What This Section Covers

This section focuses on discrepancy-based sequence analysis: overall discrepancy, pseudo-ANOVA on dissimilarities, weighted permutation tests, multifactor models, regression trees, and window-wise group comparisons along the time axis.

For TraMineR users, this is the diss* family plus the seqdiff and seqtree workflows described in Studer et al. (2011). Distance matrices are usually built first with seqdist() in TraMineR or get_distance_matrix() in Sequenzo.

Main Mapping Table

Sequenzo functionTraMineR counterpartNotes
overall_discrepancydissvarOverall discrepancy from a distance matrix; squared=False uses v = 1 and squared=True uses v = 2.
single_factor_associationdissassocSingle-factor pseudo-ANOVA on distances; returns pseudo F, pseudo Fbf, pseudo R², Bartlett, and Levene summaries.
marginal_factor_associationrepeated dissassocOne dissassoc() per covariate column; raw marginal association, not Type II partial effects.
multifactor_associationdissmfacwMultifactor model with Type II-style partial contributions after other covariates are included.
distance_multifactor_anovadissmfacwLower-level multifactor engine behind multifactor_association().
gower_matrixinternal Gower-centering step in dissmfacwCentered Gower matrix used for distance-based multifactor ANOVA.
individual_indicatorsTraMineRextras dissindicIndividual marginality and gain indicators; not exported from TraMineR core.
merge_cluster_groupsdissmergegroupsGreedy merging of cluster labels by partition-quality loss.
compare_groups_across_positionsseqdiffWindow-wise local discrepancy scan along the time axis.
print_group_differences_across_positionsprint.seqdiffText summary of a seqdiff object.
plot_group_differences_across_positionsplot.seqdiffPlot statistics or discrepancy profiles across anchor positions.
distance_treedisstreeDistance-based regression tree on a distance matrix plus predictors.
sequence_treeseqtreeSequence-facing wrapper that can compute the distance matrix before calling the tree fitter.
test_tree_splitinternal split-significance logic behind disstreePermutation test for one candidate tree split.
get_leaf_membershipdisstreeleafLeaf ID or readable path label for each sequence.
get_classification_rulesdisstree.get.rulesHuman-readable rules for terminal nodes.
assign_to_leavesdisstree.assignAssign new profiles to fitted leaves using tree rules.
print_treeprint.disstree / print.seqtreeText display of a fitted tree.
plot_treeplot.disstree / plot.seqtreeGraphical tree display.
export_tree_to_dotdisstree2dot / seqtree2dotExport a tree to Graphviz DOT format.
permutation_testTraMineR.permutationGeneric permutation wrapper.
association_permutation_testdissassocweighted.*Five-statistic dissassoc permutation engine used by single_factor_association().

Parameter Mapping for Core Entry Points

Sequenzo argumentTraMineR argumentApplies to
distance_matrixdissoverall_discrepancy, single_factor_association, distance_tree, multifactor helpers
groupgroup / facsingle_factor_association
weightsweightsAll weighted discrepancy functions
RRAssociation tests, trees, and multifactor routines that support permutation
weight_permutationweight.permutationsingle_factor_association, distance_tree, sequence_tree
squaredsquaredAll routines that accept a nonsquared (v = 1) versus squared (v = 2) dissimilarity transform
predictorsformula right-hand predictorsdistance_tree, sequence_tree
min_sizemin.sizedistance_tree, sequence_tree
max_depthmaxdepthdistance_tree, sequence_tree
pvalpvaldistance_tree, sequence_tree
first_splitfirst.splitdistance_tree, sequence_tree
seqdataleft-hand formula term in seqtreesequence_tree, compare_groups_across_positions
distance_method / distance_paramsseqdist.argssequence_tree
seqdist_argsseqdist.argscompare_groups_across_positions
cmprangecmprangecompare_groups_across_positions
with_missingwith.missingcompare_groups_across_positions
weightedweightedsequence_tree, compare_groups_across_positions
factorsformula predictors in dissmfacwmultifactor_association, marginal_factor_association
gowergowermultifactor_association, individual_indicators

TraMineR tree functions also accept max.depth and first as formal argument names. This guide uses maxdepth and first.split to match the Studer et al. (2011) examples and the other pages in this section.

Important Workflow Differences

  • Import surface. Import discrepancy functions from sequenzo.discrepancy_analysis only. Internal folders such as stats/, trees/, positionwise/, and internal/ are for maintainers.
  • Distance input. TraMineR often passes a dist object or matrix through a formula. Sequenzo usually takes an explicit distance_matrix, except in sequence_tree() and compare_groups_across_positions().
  • Weighted permutation default. Sequenzo resolves weight_permutation=None the same way TraMineR does for dissassoc(), disstree(), and seqtree(): "none" without weights and "replicate" when weights are supplied. Unweighted calls also resolve to "none" inside TraMineR dissassocweighted() and DTNdisstree(). For survey or calibration weights, pass weight_permutation="diss" explicitly, as recommended by Studer et al. (2011). The seqdiff workflow calls dissassoc(..., weight.permutation = "diss") for local window scans, and compare_groups_across_positions() follows that path.
  • Marginal versus multifactor. marginal_factor_association() is not a substitute for dissmfacw. Use multifactor_association() when you need conditional Type II-style contributions after other covariates are included.
  • Position-wise scan. compare_groups_across_positions() rebuilds local distance matrices inside a moving window. It is not a cell-by-cell state composition comparison unless the window length is effectively one.
  • Representative and factor plots. TraMineR also provides disscenter, dissrep, dissrf, dissdomassoc, disstreedisplay, and seqtreedisplay. Sequenzo does not expose one-to-one public wrappers for those helpers in this module.
TraMineR functionTypical role
disscenterGravity center / medoid search from a distance matrix
dissrepRepresentative sequence selection from distances
dissrfRandom forest on distances
dissdomassocAssociation between domain-specific distance matrices
disstreedisplay / seqtreedisplayRich tree displays beyond the basic plot_tree() helper

Author

Code and documentation: Yuqi Liang

Reference

Studer, M., Ritschard, G., Gabadinho, A., & Müller, N. S. (2011). Discrepancy analysis of state sequences. Sociological Methods & Research, 40(3), 471–510.