Skip to contents

latents reports errors, warnings and messages to communicate problems with input data, difficulties during estimation, and limitations of requested analyses. Errors indicate that an operation could not be completed. Warnings identify issues requiring attention when interpreting or using a result. Messages provide progress updates or supplementary information.

Value

Nothing; this page documents conditions rather than a function.

Details

This reference describes the conditions that trigger these signals and their associated classes. In automated analyses, conditions can be handled by class using tryCatch() or withCallingHandlers(). Class-based handling allows scripts to respond to specific situations without depending on message wording, which may change between versions.

Input validation

latents_bad_data

The data frame, the indicator columns or the group column are invalid: too few rows, a duplicated or absent column name, an indicator that is not a numeric vector, an indicator that is constant or entirely unobserved, missing or non-finite values under missing = "error", or a missing group identifier. Also raised when an outcome, covariate or variable named in an argument is not a column of the data given to three_step(), r3step() or descriptives(); when newdata given to predict() cannot be used (latents-predict); and when imputed given to pool_imputations() is not a list of at least two data frames with the same columns and rows.

latents_unweightable_level

The stored sampling weights cannot be aligned with a classification level, for example in an older cross-level fit without a row-to-group mapping. diagnostics() handles this condition internally and reports the affected checks as n/a.

latents_not_a_fit

A function requiring a fitted model received an unsupported object or a model from an unsupported family. The message identifies the supplied object. Also inherits from latents_bad_argument.

latents_bad_argument

An argument has an invalid value: a scalar such as n_profiles, n_group_classes, n_starts, max_iter, tol or min_variance; a seed or seeds that is not a whole number accepted by set.seed(); a what naming a table or view the object does not have, or a what that is NA, not text or more than one name; an enumerated option such as missing, boundary, select_start, acceleration, centering, scaling, variance_model, covariance_model, vcov_type or adjust given a value that is not one of its choices; or an argument the function or table does not use.

latents_bad_time

time is missing, or repeats a position within a group.

latents_bad_categorical

A categorical indicator cannot be encoded, or min_probability is too large for its number of categories.

latents_bad_start

Supplied starting values lack a block the model needs, have the wrong shape, or carry labels naming an indicator or category the fit does not have.

latents_bad_fixed

A fixed request names a block the model does not have or that start does not supply, or start is absent.

latents_bad_stage

A measurement fit given to fit_staged() already has more than one group class; was fitted to different indicators, profiles or measurement options than the stage requests; or was fitted with weights, centering, or ordinal or count indicators.

latents_bad_transition

A transition model was requested with fewer than two profiles, or with no group observed at two occasions.

latents_bad_inference_data

Data supplied with a fitted model differ from the fitting data in row count, values or group ordering.

latents_no_indicator_data

A fit carries no stored indicators, so the request needs the original data.

latents_incomplete_fit

A fit lacks fields the request needs, usually because it was made by an older version.

Estimation and identification

latents_unidentified

The requested model is not identified from the data: more profiles than distinct observed indicator rows, more group classes than groups, or more than one group class with only one profile or only singleton groups, or a known structurally unidentified short-panel transition specification. Raised as a warning, and the fit returned, for a model of complete categorical and ordinal indicators with one group class that has more free parameters than free cells of its table (negative degrees of freedom); a model with membership covariates is not judged by that count.

latents_all_starts_failed

Every EM start failed, so no fit was produced. The message gives the distinct start errors.

latents_empty_profile

A profile has no observed responses for an indicator, so its response probabilities are not identified; or a group class has no effective membership, so its profile prevalences are not defined.

latents_too_few_groups

There are too few independent groups to form the covariance of the reported quantities. Raised by robust and OPG parameter_inference(), and by three_step() and r3step(), whose cluster-robust contributions sum to zero at the estimate and so span at most one dimension fewer than the number of groups.

latents_inseparable_classes

The classes are not separated well enough for the requested three-step correction.

latents_too_many_cores

cores exceeds the machine's core count; the fit uses the machine's count instead.

latents_unknown_cores

cores is above one but the platform does not report its processor count (for example R in WebAssembly); the fit uses one core.

latents_no_converge

A fit required by the request did not converge.

latents_vanished_density

Every component density is zero, or one overflowed, at a point EM reached: the start is recorded as failed (get_results(x, "starts")), and a fit whose every start fails raises latents_all_starts_failed.

latents_boundary_fit

A variance or response probability is at its bound, a mixing probability is zero, or a membership logit coefficient diverges (separation), including pooled and transition three-step membership regressions. The usual normal approximation for Wald inference does not apply at the parameter boundary, so standard errors are unavailable under the requested inference method.

latents_singular_information

The observed information is not positive definite or is numerically singular, so no standard error can be formed.

latents_unknown_candidate

The requested profile and group-class combination was not enumerated.

latents_failed_candidate

An enumerated candidate could not be fitted. The message gives that candidate's error.

latents_no_group_classes

A table, level or view that needs discrete group classes was requested from a model without them, for example level = "groups" for a fit without group classes, or a group-level plot of a fit with fewer than two group classes.

Model comparison

latents_bad_nesting

Two models are not nested as the comparison requires, including a bootstrap_lrt() pair whose held measurement blocks differ, are held at different values, or are held in only one of the two models.

latents_singular_restriction

Two models are nested, but the restriction is singular at the null, so the likelihood-ratio statistic has no chi-square reference: in compare_models(test = "lrt"), a spherical covariance structure (EII, VII) within EVE, VVE, EEV or VEV. Also inherits from latents_bad_nesting.

latents_incomparable_models

Two models were fitted to different data, or differ in covariance structure, centering, scaling mode or drop_empty where the comparison requires them to match.

latents_parallel_failure

The worker cluster could not be started, or a broken cluster's surviving processes could not be stopped safely. A process lost during fitting is otherwise retried and reported with latents_worker_lost instead.

latents_worker_lost

One or more worker tasks returned no result, possibly because the operating system terminated them for excessive memory use. Missing results are retried once with fewer workers. The warning reports the numbers lost, recovered and still failed, and suggests fewer cores. Persistent losses become failed starts or candidate rows, retaining other results. After a socket connection failure, the affected batch is retried and results from previously completed batches are retained.

latents_suspect_categorical

A numeric indicator fitted as categorical has non-integer values or more than ten categories, so it may be continuous. Every distinct value is fitted as a category. The warning names the indicators (field indicators) and is given once per call, including an enumeration.

latents_progress

A message from enumerate_classes() with verbose = TRUE (the default when cores > 1): one as the candidates are prepared, one as their starts are fitted, and one when the grid is done. Muffle it with suppressMessages(classes = "latents_progress") or verbose = FALSE.

latents_candidate_failed

A candidate of an enumeration that was fitted as one worker task lost that worker twice. It is recorded as the candidate's error, in its row of the grid, and the other candidates are returned.

latents_reversed_likelihood

The larger nested model has a lower likelihood, indicating that at least one fit has not reached its global maximum.

latents_bad_outcome

A distal outcome given to three_step() is a measurement indicator, varies within a group when a group-level outcome is requested (within a person, for a trajectory model), or takes a single category or value among the units analysed, so it has no distribution to compare across classes.

latents_bad_covariate

A predictor given to r3step() varies within a group when group-level membership is predicted, makes the design rank deficient, or is a measurement indicator; or a predictor given to multilpa(profile_covariates =, group_covariates =) is an indicator or the group identifier, or makes the membership design rank deficient.

multilpa_indicator_reused

A measurement indicator was given as an outcome to three_step() or as a predictor to r3step(). Raised together with latents_bad_outcome or latents_bad_covariate.

latents_bad_scores

Score contributions for the robust sandwich could not be formed.

Unsupported requests

These are raised when the package does not implement the requested analysis.

latents_unsupported_inference

Standard errors are not available for this fit. Raised by parameter_inference() for a fit made with prior (Wald method), for the cross-level families, for a covariate fit made by an older version, and for a fit recording a covariance structure code this version does not know; and by parameter_inference(method = "bootstrap") for an additive or covariate fit, a multilevel growth mixture, or a fit holding a measurement block through fixed, or a staged fit whose measurement was estimated on different data or has unknown provenance. Also raised by vcov(scale = "unconstrained") for a bootstrap covariance.

latents_unsupported_prior

multilpa(prior = ) was combined with an option the conjugate prior is not defined for: the VEE, EVE, VVE or EVV covariance structure (mclust defines none), categorical indicators, a fixed block, membership covariates, or missing indicator values.

latents_unsupported_noise

multilpa(noise = TRUE) was combined with more than one group class, categorical indicators, a fixed block, membership covariates or missing indicator values; or a fit with a noise component was given to a function that does not support one: parameter_inference(), three_step(), r3step(), bootstrap_lrt(), starting_values(), bivariate residuals, fit_staged() or a posterior plot. Also raised by predict() for partially observed rows when the fitted model has a noise component, because its stored hypervolume does not define the required marginal noise density.

latents_bch_out_of_range

Warning from three_step() when the BCH weights give a categorical outcome a class probability outside [0, 1]; the probability is reported without an interval or test.

latents_bad_weights

weights does not name a column, or its values are missing, negative, non-finite, vary within a unit, or are positive for fewer than two units.

latents_unsupported_weights

A weighted fit was given to a function or option that does not support sampling weights: bootstrap_lrt(), enumerate_regressions(bootstrap = ), three_step(), r3step(), prior or noise; or a vcov_type other than "robust" was requested for it.

latents_unsupported_indicator

ordinal or count indicators were combined with an option that does not support them: membership covariates, start, fixed, prior or noise.

latents_pooling_failed

A fit or its inference failed for one imputation in pool_imputations(), or the imputations' fits report different parameters. No imputation is dropped; the message names the imputation and gives the original reason.

latents_bootstrap_failed

Fewer than two resamples produced a usable fit. Raised by parameter_inference(method = "bootstrap"); the message gives the first reason a resample failed.

latents_no_free_parameters

The fit holds every parameter fixed, so there is no standard error to report. Raised by parameter_inference() and vcov().

latents_held_parameter

A parameter named in parm was held fixed by the fit and has no confidence interval. Raised by confint().

latents_unsupported_sensitivity

sensitivity() cannot refit the requested model or align its class labels: a membership-covariate fit, or a directly fitted fixed-measurement model whose original free starting values were not retained.

latents_unsupported_three_step

three_step() or r3step() was called on a fit the correction does not cover: a membership-covariate fit, whose classification errors depend on the predictors (the correction uses one unconditional error matrix); a multilevel growth mixture; a general lta() fit (occasion-varying, second-order or covariate transitions, occasion-specific measurement, a stayer class, or ordinal or count indicators), except that r3step() takes initial_covariates and transition_covariates for one with invariant measurement, one group class, no covariates and no stayer class; an additive, dispersion or cross-level multilpa() fit; or a mixture regression with observation classes. Also raised by three_step(step_one = "estimated") for a transition fit, a trajectory model, a staged fit or a fit holding a measurement block fixed.

latents_unsupported_bootstrap

bootstrap_lrt() was called on a person-centred fit, for which raw data cannot be simulated under the null model because the group baselines were removed before estimation.

latents_unsupported_tna

get_tna() or get_group_tna() was called on a general transition fit (an lta() fit with occasion-varying or covariate-dependent transitions, a second order, movers and stayers, or ordinal, count or weighted data), which has no single transition matrix; its transitions are given by get_results(x, "transitions").

latents_no_plot

plot(x, what = "all") was called on an object whose plot method has no views to draw.

latents_no_time

A sequence table or function was requested for a fit made without time.

latents_unsupported_prediction

predict() was called on a membership-covariate fit or a latent transition fit, for which prediction is not implemented; the posterior probabilities of the fitted rows are get_results(x, "posteriors").

latents_missing_package

A required package from Suggests is not installed. Raised by the plot functions when ggplot2 is absent, by get_tna() and get_group_tna() when tna is absent, and by pool_imputations() for a mids object when mice is absent; the message names the package and how to install it.

Plotting

latents_no_continuous, latents_no_categorical

The requested panel needs indicators of a kind the fit does not have.

latents_nothing_to_describe

descriptives() has no variables to describe: vars named none, or the frame has no numeric column outside id and by.

latents_nothing_to_plot

The requested panel has no rows to draw.

latents_inaccurate_probability

Numerical integration for a Lo-Mendell-Rubin p-value did not meet the required accuracy, so the p-value is unavailable.

latents_no_local_dependence

get_results(fit, "local_dependence") on a fit made without local_dependence.

latents_no_direct_effects

get_results(fit, "direct_effects") on a fit made without direct_effects.

latents_partial_pair

Not raised. A row observing one item of a local_dependence pair contributes that item, with the pair's other item summed out.

latents_no_lmr

get_results(x, "lmr") on a grid with no two converged candidates one profile or one group class apart. Also of class latents_nothing_to_plot.

latents_invalid_lmr

The alternative of a nested LMR comparison has a lower likelihood than the null beyond numerical roundoff. The comparison table retains its row with unavailable statistics and the reason in note; improve the alternative's fit before comparing.

latents_no_tree

A tree would have fewer than two rows, or the group level of a grid with one group class was asked for. Also of class latents_nothing_to_plot; get_results(x, "all") leaves the "tree" table out.

latents_unsupported_view

A grid function (plot_enumeration(), plot_selection(), plot_tree() or plot() of a grid) was asked for a view that this kind of grid cannot draw, such as the tree of a group-class family or regression grid. The message gives the reason and the views the grid offers; plot_views(x) lists them. Also of class latents_bad_argument.

latents_unknown_category, latents_unknown_criterion

A named category or information criterion does not exist in the fit. An unknown criterion of a grid is also of class latents_bad_argument.

latents_bad_scale

An unrecognised plotting scale was requested, or scale = "standardized" met an indicator with zero or undefined standard deviation.

Additional errors, warnings and messages

These conditions report limitations of a returned result or an inability to complete estimation. Message-only conditions are identified explicitly.

latents_failed_starts

Some, but not all, EM starts failed. The remaining starts are in get_results(fit, "starts").

latents_not_identified

mixture_regression() with a binary outcome and one trial per class assignment, where a mixture of Bernoulli regressions is not identified; a repeated categorical mixture exceeding the distinguishable response-pattern capacity; or a growth specification whose random/residual covariance decomposition is rank deficient on the observed occasions.

latents_missing_data

mixture_regression() with missing = "error" met a missing value in a variable the model uses.

latents_rows_dropped

mixture_regression() with missing = "omit" dropped incomplete rows; the message states how many.

latents_no_valid_start

Every mixture_regression() start degenerated: a class emptied or its variance collapsed.

latents_degenerate_start

Some mixture_regression() starts degenerated and were set aside.

latents_separation

A mixture_regression() logit or log-link coefficient diverged (perfect separation); it and its standard error are unreliable.

latents_em_decrease

The mixture_regression() EM likelihood decreased beyond rounding error. This indicates a defect and should be reported.

latents_unconverged

The selected start did not satisfy the convergence criterion before max_iter, or an inference check found a non-negligible score. The returned estimate requires further assessment.

latents_boundary

A variance, or a covariance eigenvalue, is at min_variance, or an initial, transition or group-class probability of a transition fit is at its bound, so the fit is bound-active and its standard errors are not valid at that parameter. Also a warning from three_step(method = "ml") when a class probability of a categorical outcome is estimated at 0 or 1 (the estimates are reported without standard errors, intervals or tests), or when a class variance of a numeric outcome reached its lower bound.

latents_atomic_groups

Under centering = "person" with scaling = "person", some groups have fewer than three observations of an indicator. Standardizing two values within a group makes them exactly -1/sqrt(2) and 1/sqrt(2), so those rows carry only a sign pattern, and a profile can collapse onto them. The message gives the share of rows in such groups. When every group is like that, the fit is refused with latents_bad_data instead.

latents_small_classes

A profile or group class has an effective membership below one observation; or, in three_step() with any method, a class is carried by a single unit (fewer than 1.5 effective carrying units, by Kish's formula), so its standard error is reported as NA.

latents_cross_level_criteria

A cross-level fit has group classes. Its likelihood counts the ratings twice, so its criteria do not choose the number of group classes or the form.

latents_unweighted_descriptives

descriptives() received a fit with sampling weights. Its table describes recorded rows without weights, including zero-weight rows, and its ICC is unweighted.

latents_thin_profiles

A Gaussian component with free variances of its own has posterior membership mass below the number of free parameters in its Gaussian density. This is a heuristic prompt to inspect the solution, not a proof of singularity or nonidentification. Covariances held at zero and held means are excluded, and held variances do not trigger it. Memberships use normalized sampling weights and only rows with an observed Gaussian indicator; this mass is not an independent sample count or a weight effective sample size. Transition models check occasion-specific measurement separately; cross-level models check both Gaussian levels. The estimate is returned unchanged. See get_results(fit, "gaussian_diagnostics") for continuous covariance and support diagnostics; none supplies an automatic spike classification or an identification guarantee.

latents_all_starts_boundary

boundary = "exclude" found every start with a variance at min_variance, so none was set aside and the best start across all of them is reported.

latents_weak_class

multilpa(family = "additive") only: a group class is supported by fewer than 50 effective groups (see effective_groups in get_results()), because it is small, poorly separated, or both. Standard errors are reported, but intervals for class means and weights may be miscalibrated.

latents_failed_replicates

Some bootstrap replicates failed validation, so the bootstrap p-value is NA.

latents_single_level

A message, not a warning: id = NULL was passed, so the fit has one observation per unit and no second level. Raised by multilpa() on every such fit and once by an enumerate_classes() grid; suppressMessages() or a latents_single_level handler silences it.

latents_single_start

A message, not a warning: one or more converged candidates of an enumerate_classes(), enumerate_lpa() or enumerate_lca() grid, fitted from two or more starts, reached their best log likelihood from one start only, so a higher maximum may exist that no start found. The message names them; refit those you consider with more n_starts. Raised once per grid.

latents_bootstrap_dropped

Some resamples did not produce a usable fit and were excluded from the interval. Raised by parameter_inference(method = "bootstrap"); the message states how many.

latents_sensitivity_dropped

One or more seeds did not produce a fit in sensitivity(). Their rows are NA, and the warning states how many failed and the first reason.

latents_extreme_coefficients

A membership logit coefficient is extreme after adjustment for covariate location and scale. This may indicate separation or sparse class membership and requires inspection before interpreting the coefficient or its standard error.

latents_empty_transition_row

A profile is never occupied before a final occasion, so its transition row is uniform by construction rather than estimated; get_results(fit, "transitions", estimated = FALSE) lists such rows. The general lta() engine raises it too, for an origin profile (or pair, under order = 2) that no move leaves: its logits are fixed at zero and marked estimated = FALSE in get_results(fit, "transitions") and parameter_inference(). In both engines such a row is not counted in n_parameters, AIC or BIC. The transition-network handoff also warns when it includes such a row.

latents_weak_transition_support

A transition origin has positive but less than one expected outgoing move. Its formal parameters remain counted, but its rows are marked supported = FALSE, their expected counts are reported, and Wald inference is refused. This diagnostic threshold signals weak information rather than structural identification.

latents_unidentified_occasion

An lta() fit with transitions = "occasion" has an occasion at which no row observes an indicator, followed by an occasion that does. The moves into and out of the empty occasion (or, for an empty first occasion, the initial distribution and the first move) enter the likelihood only through their product, so their logits are not separately identified: the distinct parameter combinations yield the same likelihood. Their standard errors are not interpretable, although the parameter count includes them. Occasions after the last observed one are not counted and do not warn.

latents_unverified_alignment

A supplied data frame has too little fitted information to verify row order (for example only a repeated group identifier). The result assumes the rows are in fitting order.

latents_random_boundary

A growth mixture's random-effect covariance is degenerate in a class (a variance at its floor, or perfectly correlated random effects), or, with residual_correlation, the residual variance, process variance or process rate is on its bound; the standard errors of those parameters are not reported.

latents_singular_covariance

A growth mixture with correlated residuals met a marginal covariance that is numerically singular (a process variance far larger than the residual variance). During fitting this is treated as a rejected step; it reaches the caller only for parameter values supplied explicitly.

latents_unused_argument

A method that accepts ... (several plot() methods, summary() of the fits and grids whose summary takes no level or vcov_type, vcov(), predict() and descriptives() of a data frame) was given an argument it does not use, or multilpa() or lta() was given a count_model or count_dispersion that changes nothing (no count indicator, or a dispersion option for a Poisson model). The call proceeds and the warning names the argument.

latents_unused_category

An ordinal indicator is a factor with levels never observed in the data. Their intercepts diverge, so Wald inference is refused; call droplevels() before fitting. It is a warning rather than an error because bootstrap refits keep the fitted categories.

latents_no_standard_errors

A message, not a warning: a table that includes standard errors by default could not compute them for this fit (a bound-active or unconverged fit, singular information, or a family or noise component without inference), so they are NA and the message gives the reason. Passing data to get_results(x, "profiles") or "responses" raises the underlying condition instead.

Examples

fit <- lpa(faithful, c("eruptions", "waiting"), n_profiles = 2,
           n_starts = 2, seed = 1)
# A fit made without `time` has no sequences; handle that by its class.
tryCatch(get_results(fit, "sequences"),
         latents_no_time = function(condition) {
  "No occasion ordering was specified for this fit."
})
#> [1] "No occasion ordering was specified for this fit."
# Every condition of the package can be caught and inspected the same way.
tryCatch(three_step(fit, faithful, "eruptions"),
         latents_bad_outcome = function(condition) conditionMessage(condition))
#> [1] "`eruptions` helped define the fitted classes, so it is not a distal outcome."