Last data update: 2014.03.03

R: Refit an randomLCA object
refitR Documentation

Refit an randomLCA object

Description

Refits an randomLCA object using new data. For an example, see the simulate method.

Usage

## S3 method for class 'randomLCA'
refit(object, newpatterns, newfreq, useinit=FALSE, ...)

Arguments

object

randomLCA object

newpatterns

the new patterns that are to be fitted using the existing model

newfreq

the frequencies corresponding to the patterns if required

useinit

use initial values from randomLCA object

...

additional argument; currently none is used.

Details

The useunit parameter determines whether the parameter estimates from the supplied model are used as initial values or whether the complete model fitting process is repeated. If the initial values are used then fitting will be faster, and the fitted classes will be similar to those in the original model. If the data was not generated from the original model there is an increased risk that the fit will not find the global maxima. For this reason when performing a bootstrap Likelihood ratio test it is better to use useinit=FALSE. However when using useinit=FALSE there may be label switching, where the estimated classes are similar, but in a different order. Unless the estimated parameters are assigned to teh correct classes this will invalidate the results of a parametric bootstrap for parameter confidence intervals.

Value

The fitted model to the new data.

Author(s)

Ken Beath

Results