library(kmlcov)
res <- glmClust(formula = latency ~ clust(time),
data = data, ident = 'id', timeVar = 'time', nClust = 2)
如何为每个id获取它们所属的预测集群?
预测的集群在kmlcov
包中称为分区。你可以通过以下方式获得它:
res <- glmClust(formula = Y ~ clust(time + time2 + time3) + pop(treatTime),
data = artifdata, ident = 'id', timeVar = 'time', effectVar = 'treatment', nClust = 4)
res@partition