permute.class {lcca} | R Documentation |
The generic method permute.class
reorders the latent classes in
the result of a call to the modeling functions lca
,
lcacov
or lcca
.
permute.class(x, ...) ## S3 method for class 'lca' permute.class(x, perm = (x$nclass:1), ...) ## S3 method for class 'lcacov' permute.class(x, perm = (x$nclass:1), ...) ## S3 method for class 'lcca' permute.class(x, perm = (x$nclass:1), ...) ## Default S3 method: permute.class(x, ...)
x |
an object used to select a method. Should be an object of
class |
perm |
a permutation of the integers
|
... |
additional arguments to be passed to the methods. |
The likelihood function for a latent-class model is invariant to
permutations of the class
labels. The order of the classes as they appear in the result of a
call to lca
, lcacov
or lcca
will depend on the
starting values for the parameters. The generic method
permute.class
will change the
order of the classes in the components of these objects, and in the printed
summaries produced when the summary
method is applied to them.
An object of the same class as a
containing the results from a
latent-class model, with classes arranged in a new order.
Joe Schafer
Send questions to mchelpdesk@psu.edu
### fit a two-class model to the HIV test data data(hivtest) set.seed(123) fit <- lca( cbind(A,B,C,D)~1, data=hivtest, freq=COUNT ) summary(fit) ### now reverse the order of the classes fit <- permute.class(fit, c(2,1) ) summary(fit)