Discrepancy Analysis: Sequenzo and TraMineR Mapping
This page maps Sequenzo discrepancy-analysis functions to their closest R counterparts. Most names below are from TraMineR core; dissindic() is from TraMineRextras.
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 function | R counterpart | Notes |
|---|---|---|
overall_discrepancy | TraMineR::dissvar() | Overall discrepancy from a distance matrix; squared=False uses v = 1 and squared=True uses v = 2. |
single_factor_association | TraMineR::dissassoc() | Single-factor pseudo-ANOVA on distances; returns pseudo F, pseudo Fbf, pseudo R², Bartlett, and Levene summaries. |
marginal_factor_association | repeated TraMineR::dissassoc() | One dissassoc() per covariate column; raw marginal association, not Type II partial effects. |
multifactor_association | TraMineR::dissmfacw() | Multifactor model with Type II-style partial contributions after other covariates are included. |
distance_multifactor_anova | TraMineR::dissmfacw() | Lower-level multifactor engine behind multifactor_association(). |
gower_matrix | internal Gower-centering step in TraMineR::dissmfacw() | Centered Gower matrix used for distance-based multifactor ANOVA. |
individual_indicators | TraMineRextras::dissindic() | Individual marginality and gain indicators; not exported from TraMineR core. |
merge_cluster_groups | TraMineR::dissmergegroups() | Greedy merging of cluster labels by partition-quality loss. |
compare_groups_across_positions | TraMineR::seqdiff() | Window-wise local discrepancy scan along the time axis. |
print_group_differences_across_positions | print() on a TraMineR seqdiff object | Text summary of a seqdiff object; TraMineR registers this as an S3 method. |
plot_group_differences_across_positions | plot() on a TraMineR seqdiff object | Plot statistics or discrepancy profiles across anchor positions; TraMineR registers this as an S3 method. |
distance_tree | TraMineR::disstree() | Distance-based regression tree on a distance matrix plus predictors. |
sequence_tree | TraMineR::seqtree() | Sequence-facing wrapper that can compute the distance matrix before calling the tree fitter. |
test_tree_split | internal split-significance logic behind TraMineR::disstree() | Permutation test for one candidate tree split. |
get_leaf_membership | TraMineR::disstreeleaf() | Leaf ID or readable path label for each sequence. |
get_classification_rules | TraMineR::disstree.get.rules() | Human-readable rules for terminal nodes. |
assign_to_leaves | TraMineR::disstree.assign() | Assign new profiles to fitted leaves using tree rules. |
print_tree | print() on TraMineR disstree / seqtree objects | Text display of a fitted tree; TraMineR registers these as S3 methods. |
plot_tree | TraMineR::disstreedisplay() / TraMineR::seqtreedisplay() | GraphViz-based tree display for fitted distance-tree or sequence-tree objects. |
export_tree_to_dot | TraMineR::disstree2dot() / TraMineR::seqtree2dot() | Export a tree to Graphviz DOT format. |
permutation_test | TraMineR internal permutation wrapper | Generic permutation wrapper aligned with TraMineR's internal permutation logic. |
association_permutation_test | TraMineR internal dissassocweighted.* helpers | Five-statistic dissassoc permutation engine used by single_factor_association(). |
Parameter Mapping for Core Entry Points
| Sequenzo argument | TraMineR argument | Applies to |
|---|---|---|
distance_matrix | diss | overall_discrepancy, single_factor_association, distance_tree, multifactor helpers |
group | group / fac | single_factor_association |
weights | weights | All weighted discrepancy functions |
R | R | Association tests, trees, and multifactor routines that support permutation |
weight_permutation | weight.permutation | single_factor_association, distance_tree, sequence_tree |
squared | squared | All routines that accept a nonsquared (v = 1) versus squared (v = 2) dissimilarity transform |
predictors | formula right-hand predictors | distance_tree, sequence_tree |
min_size | min.size | distance_tree, sequence_tree |
max_depth | maxdepth | distance_tree, sequence_tree |
pval | pval | distance_tree, sequence_tree |
first_split | first.split | distance_tree, sequence_tree |
seqdata | left-hand formula term in seqtree | sequence_tree, compare_groups_across_positions |
distance_method / distance_params | seqdist.args | sequence_tree |
seqdist_args | seqdist.args | compare_groups_across_positions |
cmprange | cmprange | compare_groups_across_positions |
with_missing | with.missing | compare_groups_across_positions |
weighted | weighted | sequence_tree, compare_groups_across_positions |
factors | formula predictors in dissmfacw | multifactor_association, marginal_factor_association |
gower | gower | multifactor_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_analysisonly. Internal folders such asstats/,trees/,positionwise/, andinternal/are for maintainers. - Distance input. TraMineR often passes a
distobject or matrix through aformula. Sequenzo usually takes an explicitdistance_matrix, except insequence_tree()andcompare_groups_across_positions(). - Weighted permutation default. Sequenzo resolves
weight_permutation=Nonethe same way TraMineR does fordissassoc(),disstree(), andseqtree():"none"without weights and"replicate"when weights are supplied. Unweighted calls also resolve to"none"inside TraMineRdissassocweighted()andDTNdisstree(). For survey or calibration weights, passweight_permutation="diss"explicitly, as recommended by Studer et al. (2011). Theseqdiffworkflow callsdissassoc(..., weight.permutation = "diss")for local window scans, andcompare_groups_across_positions()follows that path. - Marginal versus multifactor.
marginal_factor_association()is not a substitute fordissmfacw. Usemultifactor_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, andseqtreedisplay. Sequenzo does not expose one-to-one public wrappers for those helpers in this module.
Related TraMineR Functions Without a Direct Sequenzo Wrapper Here
| TraMineR function | Typical role |
|---|---|
TraMineR::disscenter() | Gravity center / medoid search from a distance matrix |
TraMineR::dissrep() | Representative sequence selection from distances |
TraMineR::dissrf() | Relative-frequency groups from distances |
TraMineR::dissdomassoc() | Association between domain-specific distance matrices |
TraMineR::disstreedisplay() / TraMineR::seqtreedisplay() | Rich tree displays beyond the basic plot_tree() helper |
Authors
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.