Learn R Programming

lavaSearch2 (version 1.4)

getCluster2-internal: Reconstruct the Cluster Variable from a nlme Model

Description

Reconstruct the cluster variable from a nlme model.

Usage

.getCluster2(object, ...)

# S3 method for gls .getCluster2(object, cluster, data, ...)

# S3 method for lme .getCluster2(object, ...)

Arguments

object

a gls or lme object.

...

[internal] Only used by the generic method.

cluster

[integer vector] the grouping variable relative to which the observations are iid. Only required for gls models with no correlation argument.

data

[data.frame] the data set.

Value

A list containing:

  • cluster: the cluster index for each observation.

  • n.cluster: the number of clusters.