- x
Input data. Can be:
A tna object (supports individual-level analysis)
A matrix (aggregate analysis only, unless data and id provided)
A cograph_network object
An igraph object
- data
Optional data.frame containing transition data with an ID column
for individual-level analysis. Required columns: from, to, and the
column(s) specified in id. If provided, x should be NULL or a matrix
of node labels.
- id
Column name(s) identifying individuals/groups in data. Can be
a single string or character vector for multiple grouping columns.
Required for individual-level analysis with non-tna inputs.
- level
Analysis level: "individual" counts how many people have each
triad, "aggregate" analyzes the summed/single network. Default depends
on input: "individual" for tna or when id provided, "aggregate" otherwise.
- edge_method
Method for determining edge presence:
- "any"
Edge exists if count > 0 (simple, recommended)
- "expected"
Edge exists if observed/expected >= threshold
- "percent"
Edge exists if edge/total >= threshold
Default "any".
edge_threshold
Threshold value for "expected" or "percent" methods.
For "expected", a ratio (e.g., 1.5 means 50\
The default 1.5 is calibrated for this method.
For "percent", a proportion (e.g., 0.15 for 15\
When using "percent", set this explicitly (e.g., 0.15).
Ignored when edge_method = "any". Default 1.5.
pattern
Pattern filter for which triads to include:
- "triangle"
All 3 node pairs must be connected (any direction).
Types: 030C, 030T, 120C, 120D, 120U, 210, 300. Default.
"network"
Exclude simple sequential patterns (chains/single edges).
Excludes: 003, 012, 021C. Includes stars and triangles.
"closed"
Network without chain patterns. Excludes: 003, 012, 021C, 120C.
Similar to network but also removes mutual+chain (120C).
"all"
Include all 16 MAN types, no filtering.
exclude_types
Character vector of MAN types to explicitly exclude.
Applied after pattern filter. E.g., c("300") to exclude cliques.
include_types
Character vector of MAN types to exclusively include.
If provided, only these types are returned (overrides pattern/exclude).
top
Return only the top N results (by observed count or z-score).
NULL returns all results. Default NULL.
by_type
If TRUE, group results by MAN type in output. Default FALSE.
min_transitions
Minimum total transitions for a person to be included
(individual level) or minimum triad weight (aggregate). Default 5.
significance
Logical. Run permutation significance test? Default FALSE.
n_perm
Number of permutations for significance test. Default 100.
seed
Random seed for reproducibility.