Mark leading-NA cells with an explicit state label
Source:R/sequence_terminal.R
mark_first_state.RdMirror of mark_terminal_state() for left-censored sequence data.
Replaces every cell before each row's first observed state with
the label given by state. The resulting chain has a structurally
recurrent "Start" state that everyone enters from - useful for
cohort-entry analyses where students join at different time points
and you want a uniform pre-observation marker.
Details
Unlike mark_terminal_state(), the marked state is not
absorbing in the resulting transition matrix - every transition
from "Start" goes to one of the original states (the actor's
first observed state), and the "Start" row is row-stochastic
exactly as the data dictates.