# metric: Compute internal model metric(s) In latrend: A Framework for Clustering Longitudinal Data

## Description

Compute internal model metric(s)

## Usage

 ```1 2 3 4 5 6 7 8``` ```## S4 method for signature 'lcModel' metric(object, name = c("AIC", "BIC", "WRSS", "APPA"), ...) ## S4 method for signature 'list' metric(object, name, drop = TRUE) ## S4 method for signature 'lcModels' metric(object, name, drop = TRUE) ```

## Arguments

 `object` The `lcModel`, `lcModels`, or `list` of `lcModel` objects to compute the metrics for. `name` The name(s) of the metric(s) to compute. `...` Additional arguments. `drop` Whether to return a `numeric vector` instead of a `data.frame` in case of a single metric.

## Value

For `metric(lcModel)`: A named `numeric` vector with the computed model metrics.

For `metric(list)`: A `data.frame` with a metric per column.

For `metric(lcModels)`: A `data.frame` with a metric per column.

Other metric functions: `defineExternalMetric()`, `defineInternalMetric()`, `externalMetric,lcModel,lcModel-method`, `getExternalMetricDefinition()`, `getExternalMetricNames()`, `getInternalMetricDefinition()`, `getInternalMetricNames()`
 ```1 2 3 4 5 6``` ```data(latrendData) model <- latrend(lcMethodLcmmGMM(fixed = Y ~ Time, mixture = ~ Time, id = "Id", time = "Time"), latrendData) bic <- metric(model, "BIC") ic <- metric(model, c("AIC", "BIC")) ```