Learn R Programming

latrend (version 1.0.1)

metric: Compute internal model metric(s)

Description

Compute internal model metric(s)

Usage

# S4 method for lcModel
metric(object, name = c("AIC", "BIC", "WRSS", "APPA"), ...)

# S4 method for list metric(object, name, drop = TRUE)

# S4 method for 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 drop the matrix dimensions in case of a single model output.

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.

See Also

externalMetric min.lcModels max.lcModels

Other metric functions: defineExternalMetric(), defineInternalMetric(), externalMetric,lcModel,lcModel-method, getExternalMetricDefinition(), getExternalMetricNames(), getInternalMetricDefinition(), getInternalMetricNames()

Examples

Run this code
# NOT RUN {
data(latrendData)
model <- latrend(lcMethodLcmmGMM(Y ~ Time + (1 | Id), id = "Id", time = "Time"), latrendData)
bic <- metric(model, "BIC")

ic <- metric(model, c("AIC", "BIC"))
# }

Run the code above in your browser using DataLab