% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-panel.R
\name{compare_sequence_panel_changes}
\alias{compare_sequence_panel_changes}
\title{Compare within-panel sequence changes}
\usage{
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
)
}
\arguments{
\item{panel}{A sequence panel.}

\item{method}{Distance method supported by \code{\link[=compute_sequence_distance]{compute_sequence_distance()}}.}

\item{normalise}{Distance normalisation.}

\item{indel_cost, substitution_cost}{Costs for optimal matching.}

\item{substitution_matrix}{Optional named substitution matrix.}

\item{transition_smoothing}{Smoothing for transition-profile distance.}
}
\value{
A data frame of class \code{gp3_sequence_panel_changes}.
}
\description{
Computes distance and simple structural changes between consecutive panel
occasions. The output is descriptive and does not establish a causal or
psychological change.
}
\examples{
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"
)
}
