Learn R Programming

LCPA (version 1.0.0)

summary: S3 Methods: summary

Description

Generates structured, comprehensive summaries of objects produced by the LCPA package. This generic function dispatches to class-specific methods that extract and organize key information including model configurations, fit statistics, parameter estimates, simulation truths, and diagnostics. Designed for programmatic access and downstream reporting.

Usage

# S3 method for LCA
summary(object, digits = 4, I.max = 5, ...)

# S3 method for LPA summary(object, digits = 4, I.max = 5, ...)

# S3 method for LTA summary(object, digits = 4, I.max = 5, ...)

# S3 method for LCPA summary(object, digits = 4, I.max = 5, ...)

# S3 method for sim.LCA summary(object, digits = 4, I.max = 5, ...)

# S3 method for sim.LPA summary(object, digits = 4, I.max = 5, ...)

# S3 method for sim.LTA summary(object, digits = 4, I.max = 5, L.max = 5, ...)

# S3 method for fit.index summary(object, digits = 4, ...)

# S3 method for compare.model summary(object, digits = 4, ...)

# S3 method for SE summary(object, ...)

Value

Invisibly returns a structured list containing summary components. The exact structure depends on the class of object. All returned objects carry an appropriate S3 class (e.g., summary.LCA, summary.LPA) for use with corresponding print methods.

Arguments

object

An object of one of the following classes:

  • Model objects: LCA, LPA, LCPA, LTA

  • Simulation objects: sim.LCA, sim.LPA, sim.LTA

  • Fit/comparison objects: get.fit.index, compare.model

  • Standard error objects: get.SE

digits

Number of decimal places for numeric output (default: 4). Applied universally across all methods.

I.max

Maximum number of variables/items to display (LCA, LPA, sim.LCA, sim.LPA, sim.LTA, LCPA, LTA, and compare.model only; default: 5). Controls verbosity for high-dimensional outputs.

...

Additional arguments passed to or from other methods (currently ignored).

L.max

Maximum number of latent classes/profiles to display before truncation (sim.LTA only; default: 5). Useful when models have many latent groups. Ignored for other classes.

Methods (by class)

  • summary(LCA): Summary method for LCA objects

  • summary(LPA): Summary method for LPA objects

  • summary(LTA): Summary method for LTA objects

  • summary(LCPA): Summary method for LCPA objects

  • summary(sim.LCA): Summary method for sim.LCA objects

  • summary(sim.LPA): Summary method for sim.LPA objects

  • summary(sim.LTA): Summary method for sim.LTA objects

  • summary(fit.index): Summary method for fit.index objects

  • summary(compare.model): Summary method for compare.model objects

  • summary(SE): Summary method for summary.SE objects

Details

Each method returns a named list with class-specific components optimized for structured access:

LCA

Returns a summary.LCA object with components:

call

Original function call.

model.config

List: latent_classes, method.

data.info

List: N, I, poly.value, uniform_categories.

fit.stats

List: LogLik, AIC, BIC, entropy, npar.

class.probs

Data frame: Class, Count, Proportion.

item.probs

List of matrices (first I.max items) with conditional probabilities per class/category.

convergence

List: algorithm, iterations, tolerance, loglik change, hardware (if applicable).

replication

List: nrep, best_BIC (if multiple replications performed).

digits, I.max.shown, total.items

Metadata for printing/formatting.

LPA

Returns a summary.LPA object with components:

call

Original function call.

model.config

List: latent_profiles, constraint, cov_structure, method.

data.info

List: N, I, distribution.

fit.stats

List: LogLik, AIC, BIC, entropy, npar.

class.probs

Data frame: Profile, Count, Proportion.

class.means

Matrix (first I.max variables) of profile-specific means.

convergence

List: algorithm, iterations, tolerance, loglik change, hardware (if applicable).

replication

List: nrep, best_BIC (if multiple replications performed).

digits, I.max.shown, total.vars

Metadata for printing/formatting.

LCPA

Returns a summary.LCPA object with components:

call

Original function call.

model.config

List: latent_classes, model_type, reference_class, covariates_mode, CEP_handling.

data.info

List: sample_size, variables.

fit.stats

List: LogLik, AIC, BIC, npar.

class.probs

Data frame: Class, Probability, Proportion, Frequency.

coefficients

Data frame: regression coefficients for non-reference classes (Estimate, Std_Error, z_value, p_value, 95% CI).

reference_class

Integer: reference class for multinomial logit.

convergence

List: iterations, coveraged, converg_note.

digits, I.max.shown, total.vars, has.covariates

Metadata for printing/formatting.

LTA

Returns a summary.LTA object with components:

call

Original function call.

model.config

List: time_points, latent_classes, model_type, reference_class, covariates_mode, CEP_handling, transition_mode.

data.info

List: sample_size, variables, time_points.

fit.stats

List: LogLik, AIC, BIC, npar.

class.probs

List of data frames (per time point): Class, Probability, Proportion, Frequency.

initial_model

List: coefficients (data frame), covariate_names, reference_class.

transition_models

Named list of data frames: transition coefficients per time interval (From_Class, To_Class, Estimate, Std_Error, etc.).

reference_class

Integer: reference destination class for transitions.

convergence

List: iterations, coveraged, converg_note.

digits, I.max.shown, total.vars, covariates.timeCross

Metadata for printing/formatting.

sim.LCA

Returns a summary.sim.LCA object with components:

call

Original simulation call.

config

List: N, I, L, poly.value, uniform_categories, IQ, distribution.

class.probs

Data frame: Class, Probability, Frequency.

item.probs

List of matrices (first I.max items) with true conditional probabilities per class/category.

digits, I.max.shown, total.vars

Metadata for printing/formatting.

sim.LPA

Returns a summary.sim.LPA object with components:

call

Original simulation call.

config

List: N, I, L, constraint, constraint_desc, distribution.

class.probs

Data frame: Profile, Probability, Frequency.

class.means

Matrix (first I.max variables) of true profile-specific means.

cov_structure

Character: detailed description of covariance constraints.

digits, I.max.shown, total.vars

Metadata for printing/formatting.

sim.LTA

Returns a summary.sim.LTA object with components:

call

Original simulation call.

config

List: N, I, L, times, type, distribution, constraint (if LPA).

class.probs

List of data frames (per time point): Class, Probability, Frequency.

item.probs

Nested list (by time/item) of true conditional probabilities (if type="LCA").

class.means

List of matrices (by time) of true profile means (if type="LPA").

transition

List: mode ("fixed" or "covariate"), rate or beta/gamma coefficients, time_points.

covariates

List of data frames (per time point) with covariate summaries (Min, Max, Mean), if present.

digits, I.max.shown, L.max.shown, total.vars, total.classes

Metadata for printing/formatting.

fit.index

Returns a summary.fit.index object with components:

call

Function call that generated the fit indices.

data.info

List: N.

fit.table

Data frame: Statistic, Value, Description for -2LL, AIC, BIC, SIC, CAIC, AWE, SABIC.

digits

Numeric: precision used for formatting.

compare.model

Returns a summary.compare.model object with components:

call

Function call that generated the comparison.

data.info

List: N, I, L (named vector for two models).

fit.table

Data frame comparing fit indices for both models.

model_comparison

Data frame: Classes, npar, AvePP, Entropy.

BF

Numeric: Bayes Factor value (if computed).

BF_interpretation

Character: interpretive guidance for Bayes Factor.

lrt_table

Data frame: Test, Statistic, DF, p-value, Sig (significance markers).

lrt_objects

List: raw hypothesis test objects for further inspection.

digits

Numeric: precision used for formatting.

SE

Returns a summary.SE object with components:

call

Original function call.

method

Character: "Obs" or "Bootstrap".

diagnostics

List: method-specific diagnostic info (e.g., n.Bootstrap, hessian_cond_number).

model_type

Character: "LCA" or "LPA".

L

Integer: number of latent classes/profiles.

I

Integer: number of variables/items (NA if unknown).

nonzero_counts

List: counts of non-zero SEs by parameter type (P.Z, means/par, covs).

total_PZ

Integer: total number of class probability parameters.