Learn R Programming

latrend (version 1.1.0)

externalMetric,lcModel,lcModel-method: Compute external model metric(s)

Description

Compute external model metric(s)

Usage

# S4 method for lcModel,lcModel
externalMetric(object, object2, name, ...)

# S4 method for lcModels,missing externalMetric(object, object2, name = "adjustedRand")

# S4 method for lcModels,character externalMetric(object, object2 = "adjustedRand")

# S4 method for lcModels,lcModel externalMetric(object, object2, name, drop = TRUE)

# S4 method for list,lcModel externalMetric(object, object2, name, drop = TRUE)

Arguments

object

The lcModel, lcModels, or list of lcModel objects to compute the metrics for.

object2

The other lcModel to compare with.

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 externalMetric(lcModel, lcModel): A numeric vector of the computed metrics.

A named numeric vector containing the computed model metrics.

For externalMetric(lcModels): A distance matrix of class dist representing the pairwise comparisons.

For externalMetric(lcModels, name): A distance matrix of class dist representing the pairwise comparisons.

For externalMetric(lcModels, lcModel): A named numeric vector or data.frame containing the computed model metrics.

For externalMetric(list, lcModel): A named numeric vector or data.frame containing the computed model metrics.

References

desgraupes2018clustercritlatrend

you2018mclustcomplatrend

csardi2006igraphlatrend

hubert1985comparinglatrend

revelle2019psychlatrend

scrucca2016mclustlatrend

See Also

metric

Other metric functions: defineExternalMetric(), defineInternalMetric(), getExternalMetricDefinition(), getExternalMetricNames(), getInternalMetricDefinition(), getInternalMetricNames(), metric()

Examples

Run this code
# NOT RUN {
data(latrendData)
model1 <- latrend(lcMethodKML("Y", id = "Id", time = "Time"), latrendData)
model2 <- latrend(lcMethodLcmmGMM(fixed = Y ~ Time, mixture = ~ Time,
   id = "Id", time = "Time"), latrendData)
ari <- externalMetric(model1, model2, 'adjustedRand')
# }

Run the code above in your browser using DataLab