Learn R Programming

kmlcov (version 1.0.1)

which_best: Seek the best partitions

Description

Seek the best partitions in an object of class KmlCovList and return the best one of each fixed number of cluster.

Usage

which_best(kmlcovar, crit = "log-class-likelihood")

Arguments

kmlcovar
An object of class KmlCovList.
crit
Name of the criterion which have to be optimised, CLL for classification log-likelihood AIC for Akaike information criterion and BIC for Bayesian information criterion.

Value

An object of class GlmCluster or KmlCovList.

See Also

kmlCov

Examples

Run this code
data(artifdata)
res <- kmlCov(formula = Y ~ clust(time + time2), data = artifdata, ident = 'id',
timeVar = 'time', effectVar = 'treatment', nClust = 2:3, nRedraw = 2) # run 2 times the algorithm
best <- which_best(res) # return the best partition of each cluster
plot(best)

Run the code above in your browser using DataLab