parameter_inference.multilpa_transitions: Wald inference for a latent transition model

View source: R/transition-inference.R

parameter_inference.multilpa_transitionsR Documentation

Wald inference for a latent transition model

Description

Standard errors, tests and intervals for every parameter of an lta() fit: the measurement model, the group-class shares, each group class's initial profile distribution and its transition matrix. The scores follow the Fisher identity (each is an expected count from the forward-backward pass minus the count the fitted probabilities imply), and the observed information is the numerical Jacobian of that analytic score.

Usage

## S3 method for class 'multilpa_transitions'
parameter_inference(
  x,
  data = NULL,
  level = 0.95,
  step = 1e-04,
  vcov_type = c("observed", "robust", "opg"),
  adjust = .multilpa_p_adjust_methods,
  method = c("wald", "bootstrap"),
  iter = 199L,
  n_starts = 10L,
  max_iter = 1000L,
  tol = 1e-08,
  seed = NULL,
  boundary = c("error", "fix")
)

## S3 method for class 'multilpa_transitions'
vcov(
  object,
  data = NULL,
  step = 1e-04,
  vcov_type = c("observed", "robust", "opg"),
  scale = c("natural", "unconstrained"),
  ...
)

## S3 method for class 'multilpa_transitions'
confint(object, parm, level = 0.95, data = NULL, ...)

Arguments

x

A fitted multilpa_transitions model from lta().

data

Optional. The data frame the model was fitted to. The fit stores its indicators, codes, groups and occasions, so it is not needed; when given it must reproduce them.

level

Confidence level of the intervals.

step

Finite-difference step for the observed information.

vcov_type

"observed" (observed information), "robust" (the sandwich clustered on groups, which are the sequences) or "opg" (the outer product of the group scores).

adjust

Multiplicity correction for p_adjusted, one of the methods stats::p.adjust() accepts.

method

"wald" (the default) or "bootstrap". The bootstrap resamples persons with replacement, refits the same specification, and matches each replicate's profiles and group classes to the original's; standard_error is the replicates' standard deviation, conf_low and conf_high their percentile interval, and statistic, p_value and p_adjusted are NA. It needs data.

iter, n_starts, max_iter, tol, seed

Bootstrap resamples, the controls of each refit, and an optional seed (the caller's random state is restored).

boundary

Accepted for the generic. Transition inference holds nothing at a bound: with no bound active "fix" gives the same table as "error", and a fit with an active bound raises latents_boundary_fit under either.

object

A fitted multilpa_transitions model.

scale

"natural" (probabilities) or "unconstrained" (logits).

...

Unused.

parm

Parameters to report, as names or positions of the natural coefficients; all by default.

Value

A base data.frame with one row per natural parameter and the columns of parameter_inference(): level, outcome, term, parameter, estimate, standard_error, statistic, p_value, p_adjusted, conf_low and conf_high, named as coef() names them. An initial probability (parameter = "initial_probability", level = "profile") has outcome the profile and term the group class; a transition probability ("transition_probability") has outcome the profile moved to and term group_class_h:profile_j, the group class and the profile moved from. Probabilities and variances carry no Wald test. Attributes covariance (natural scale), covariance_unconstrained, vcov_type and level.

Conditions

latents_no_converge for an unconverged fit; latents_boundary_fit when a variance, a response, initial or transition probability, or a group-class share sits at its bound, or a transition row was never informed (a profile no group occupies before its last occasion); latents_singular_information when the information cannot be inverted; latents_bad_inference_data when a supplied data does not reproduce the fit; latents_too_few_groups for robust or OPG errors with no more groups than parameters; latents_bad_argument for method = "bootstrap" without data.

Examples

fit <- lta(subset(course_engagement, student <= 40),
           c("browse", "lectures", "forum_read"), "student",
           n_profiles = 2, time = "sequence", n_starts = 2, seed = 1)
parameter_inference(fit)

latents documentation built on Oct. 16, 2026, 5:09 p.m.