Every error a caller might reasonably want to handle carries a class, so it can be caught by what went wrong rather than by matching message text, which changes between versions. This page is the contract: the classes below are stable, the messages are not.
Input and data contracts
latents_bad_dataThe data frame, the indicator columns or the group column break the input contract: too few rows, a duplicated or absent column name, an indicator that is not a numeric vector, an indicator that is constant or wholly unobserved, missing or non-finite values under
missing = "error", or a missing group identifier.latents_bad_argumentA scalar argument is outside its contract:
n_profiles,n_group_classes,n_starts,max_iter,tol,min_variance, or aseedorseedsthat is not a whole numberset.seed()accepts.latents_bad_timetimeis missing, or repeats a position within a group, so the ordering it is supposed to supply does not exist.latents_bad_categoricalA categorical indicator cannot be encoded, or
min_probabilityleaves no room for its number of categories.latents_bad_startSupplied starting values are missing a block the model needs, do not have the shape it requires, or carry labels that name an indicator or a category this fit does not have.
latents_bad_fixedA
fixedrequest names a block the model does not have, or one thatstartdoes not supply, orstartis absent.latents_bad_stageA
measurementfit offered tofit_staged()has already estimated multiple group classes, or was fitted to different indicators, profiles or measurement options than the stage requested.latents_bad_transitionA transition model was asked for with fewer than two profiles, or with no group observed at two occasions.
latents_bad_inference_dataThe data passed to a verb alongside a fit do not reproduce the fit: a different number of rows, different values, or a different group ordering. Raised for a plain
multilpafit and for a covariate fit alike.latents_no_indicator_dataA fit carries no stored indicators, so the request cannot be answered without the original data.
latents_incomplete_fitA fit is missing fields the request needs, usually because it was made by an older version. Raised instead of letting a list subset by an absent name yield a
NULLelement keyedNA, which would leave a hole in the result.
Estimation and identification
latents_unidentifiedThe requested model cannot be identified from these 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.
latents_all_starts_failedEvery EM start raised, so no fit was produced. The message carries the distinct start errors.
latents_empty_profileA profile has no observed responses for an indicator, so its response probabilities are not identified; or a group class has no effective membership, so the profile prevalence within it is not defined.
latents_too_few_groupsFewer independent groups than the quantities being reported, so the covariance cannot be formed. Raised by robust
parameter_inference(), and bythree_step()andr3step(), 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_classesClasses cannot be separated well enough for the requested three-step correction.
latents_no_convergeA fit required by the request did not converge, and using it would report an unconverged estimate as final. Raised for a plain
multilpafit and for a covariate fit alike.latents_boundary_fitA variance or a response probability sits at its bound, or a mixing probability is zero, so the parameter is on the edge of its space and the asymptotic normal approximation Wald inference relies on does not hold. The standard error is refused rather than reported.
latents_singular_informationThe observed information is not positive definite, or is numerically singular, so it cannot be inverted and no standard error can be formed.
latents_unknown_candidateThe requested profile and group-class combination was never enumerated.
latents_failed_candidateAn enumerated candidate could not be fitted. The message carries that candidate's error.
latents_no_group_classesA verb that needs discrete group classes was called on a model that has none. Every model family this version fits has them, so this is a guard against a future family rather than a refusal the current surface can produce.
Model comparison
latents_bad_nestingTwo models are not nested in the way 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_incomparable_modelsTwo models were fitted to different data, or differ in covariance structure or centering mode where the comparison requires them to match.
latents_reversed_likelihoodThe model with more parameters has the lower likelihood, so at least one fit is at a local optimum and the comparison is meaningless.
latents_bad_outcomeA distal outcome given to
three_step()is not of a type the requested method can handle, varies within a group when a group-level outcome is requested, or is a measurement indicator that already helped define the classes.latents_bad_covariateA predictor given to
r3step()varies within a group when group-level membership is predicted, makes the design rank deficient, or is a measurement indicator that already helped define the classes. The counterpart oflatents_bad_outcome.multilpa_indicator_reusedA measurement indicator was offered as an external variable, to
three_step()as an outcome or tor3step()as a predictor. Raised alongsidelatents_bad_outcomeorlatents_bad_covariate, so one handler catches the mistake from either verb.latents_bad_scoresScore contributions could not be formed for the robust sandwich.
Unsupported requests
These name capabilities the package does not have. They are raised in place of returning a number that would be wrong.
latents_unsupported_inferenceStandard errors are not available for this particular fit. Raised for a covariate fit with categorical indicators, where no score is implemented for the response probabilities, for fits made by an older version, for a fit recording a covariance structure code this version does not know, and by
parameter_inference(method = "bootstrap")for a fit holding a measurement block, whose held values came from a fit these data do not resample, and byparameter_inference()for a fit made withprior, which sits at a posterior mode rather than a likelihood maximum.latents_unsupported_priormultilpa(prior = )was asked for a combination the conjugate prior is not defined for: the VEE, EVE, VVE or EVV covariance structure (mclust defines none), categorical indicators, afixedblock, membership covariates, or missing indicator values.latents_unsupported_noisemultilpa(noise = TRUE)was asked for more than one group class, categorical indicators, afixedblock, membership covariates or missing indicator values; or a verb that does not yet account for a noise component —parameter_inference(),three_step(),r3step(),bootstrap_lrt(),starting_values(), bivariate residuals,fit_staged()or a posterior plot — was given a fit that has one.latents_unsupported_structuremultilpa()was asked for a covariance structure other than EEI, VVI, EEE or VVV together withprofile_covariatesorgroup_covariates, which fit those four only.latents_bad_weightsweightsdoes 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_weightsA weighted fit was given to a verb or option that does not account for sampling weights:
bootstrap_lrt(),enumerate_regressions(bootstrap = ),three_step(),r3step(),priorornoise; or a non-sandwichvcov_typewas asked of one.latents_unsupported_indicatorordinalorcountindicators were combined with an option that does not take them yet: membership covariates,start,fixed,priorornoise.latents_pooling_failedAn imputation's fit or inference failed in
pool_imputations(), or the imputations' fits report different parameters. Rubin's rules need every imputation, so none is dropped; the message names the imputation and carries the original reason.latents_bootstrap_failedFewer than two resamples produced a usable fit, so there is nothing to read a spread from. Raised by
parameter_inference(method = "bootstrap"); the message carries the first reason a resample gave.latents_no_free_parametersThe fit holds every parameter it has, so there is no free coordinate to report a standard error for. Raised by
parameter_inference()andvcov()on a fully held fit.latents_held_parameterA named parameter was held fixed by this fit, so it has no sampling distribution and no confidence interval. Raised by
confint()whenparmnames a held coordinate.latents_unsupported_sensitivitysensitivity()was called on a model family whose refit needs arguments the shared refit does not carry, whose profile labels cannot yet be aligned between two fits, or a directly fixed fit whose original free starts cannot be replayed.latents_unsupported_three_stepthree_step()orr3step()was called on a membership-covariate fit. Its classification errors depend on the fitted predictors, but the correction here uses one unconditional error matrix.latents_unsupported_bootstrapbootstrap_lrt()was called on a person-centred fit. Group baselines were removed before estimation and no distribution for them is available to simulate raw data under the null model.latents_unsupported_tnaget_tna()orget_group_tna()was called on a general transition fit (alta()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 to hand over; its transitions are inget_results(x, "transitions").latents_no_plotplot(x, what = "all")was called on an object whose plot method names no views to draw.latents_no_timeA sequence verb was called on a fit made without
time, so it carries no ordering.latents_missing_packageA verb needs a package listed in
Suggeststhat is not installed. Raised byget_tna()andget_group_tna()when thetnapackage is absent; the message names the package and how to install it.
Plotting
latents_no_continuous,latents_no_categoricalThe requested panel needs indicators of a kind this fit does not have.
latents_nothing_to_describedescriptives()was given no variables to describe: eithervarsnamed none, or the frame has no numeric column outsideidandbyto fall back on.latents_nothing_to_plotThe requested panel has no rows to draw.
latents_unknown_category,latents_unknown_criterionA named category or information criterion does not exist in this fit.
latents_bad_scaleAn unrecognised plotting scale was requested.
Warnings
A fit that is returned but qualified warns rather than errors, so that a simulation loop can catch the qualification it cares about and let the others through.
latents_failed_startsSome, but not all, EM starts raised. The surviving starts are in
get_results(fit, "starts").latents_not_identifiedmixture_regression()with a binary outcome and one trial per class assignment: a mixture of Bernoulli regressions is not identified there.latents_missing_datamixture_regression()withmissing = "error"met a missing value in a variable the model uses.latents_rows_droppedWarning.
mixture_regression()withmissing = "omit"dropped incomplete rows; the message states how many.latents_no_valid_startEvery
mixture_regression()start degenerated: a class emptied or its variance collapsed.latents_degenerate_startWarning. Some
mixture_regression()starts degenerated and were set aside.latents_separationWarning. A
mixture_regression()logit or log-link coefficient diverged (perfect separation); it and its standard error are unreliable.latents_em_decreaseThe
mixture_regression()EM likelihood decreased beyond roundoff. This indicates a defect and should be reported.latents_unconvergedThe best start had not converged when
max_iterwas reached, so the returned estimate is not a maximum.latents_boundaryA variance, or a covariance eigenvalue, sits at
min_variance, so the fit is bound-active and its standard errors are not valid at that parameter.latents_small_classesA profile or group class has effective membership below one, so it is supported by less than one observation.
latents_weak_classmultilpa(family = "additive")only: a group class is supported by fewer than 50 effective groups (seeeffective_groupsinget_results.multilpa_additive()), because it is small, poorly separated, or both. Standard errors are still reported, but intervals for class means and weights can be miscalibrated.latents_failed_replicatesSome bootstrap replicates failed validation, so the bootstrap p-value is
NA.latents_single_levelA message, not a warning:
id = NULLwas passed, so the fit has one observation per unit and no second level. Raised bymultilpa()on every such fit and once by anenumerate_classes()grid;suppressMessages()or alatents_single_levelhandler silences it.latents_bootstrap_droppedSome resamples did not produce a usable fit and were left out of the interval. Raised by
parameter_inference(method = "bootstrap"), naming how many, so the count the interval rests on is never quietly smaller thaniter.latents_sensitivity_droppedOne or more seeds did not produce a fit in
sensitivity(). Their rows areNArather than absent, and the warning names how many failed and the first reason, so the table is never quietly shorter thanseeds.latents_extreme_coefficientsA membership logit coefficient is large enough that the class is close to separated, so the estimate is driven by scaling, a sparse class or separation rather than by the data.
latents_empty_transition_rowA 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 them. The transition-network handoff also warns when it includes such a row, because it cannot be read as evidence of persistence.latents_unverified_alignmentA supplied
dataframe has too little fitted information to establish row order, for example only a repeated group identifier. The result is returned on the caller's assurance that the rows are in fitting order.
Examples
set.seed(1)
example_data <- data.frame(
school = rep(seq_len(8), each = 6),
score_a = stats::rnorm(48), score_b = stats::rnorm(48)
)
fit <- multilpa(example_data, c("score_a", "score_b"), "school",
n_profiles = 2, n_group_classes = 1, n_starts = 2, seed = 1)
# A sequence verb on a fit made without `time` is catchable by class.
tryCatch(get_results(fit, "sequences"),
latents_no_time = function(condition) {
"this fit carries no ordering"
})
#> [1] "this fit carries no ordering"
