View source: R/sequence-panel.R
| compare_sequence_panel_changes | R Documentation |
Computes distance and simple structural changes between consecutive panel occasions. The output is descriptive and does not establish a causal or psychological change.
compare_sequence_panel_changes(
panel,
method = c("levenshtein", "lcs", "optimal_matching", "transition"),
normalise = c("none", "max_length", "path_length"),
indel_cost = 1,
substitution_cost = 1,
substitution_matrix = NULL,
transition_smoothing = 0
)
panel |
A sequence panel. |
method |
Distance method supported by |
normalise |
Distance normalisation. |
indel_cost, substitution_cost |
Costs for optimal matching. |
substitution_matrix |
Optional named substitution matrix. |
transition_smoothing |
Smoothing for transition-profile distance. |
A data frame of class gp3_sequence_panel_changes.
panel_data <- data.frame(
participant_id = rep(c("p1", "p2"), each = 8L),
occasion = rep(rep(c(1, 2), each = 4L), times = 2L),
sequence_id = rep(c("a", "b", "c", "d"), each = 4L),
sequence_order = rep(1:4, times = 4L),
state = c("A", "B", "C", "D", "A", "C", "C", "D",
"D", "C", "B", "A", "D", "B", "B", "A")
)
compare_sequence_panel_changes(
prepare_sequence_panel(panel_data, "participant_id", "occasion"),
method = "lcs"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.