Learn R Programming

flexmix (version 1.1-2)

refit: Refit a Fitted Model

Description

Refits an estimated flexmix model to obtain additional information like coefficient significance p-values for GLM regression.

Usage

## S3 method for class 'flexmix':
refit(object, model=1, ...)

Arguments

object
an object of class "flexmix"
model
The model (for a multivariate response) that shall be refitted.
...
currently not used

Details

Currently there is only a refit method for FLXglm models, which in combination with the summary method can be used to obtain the usual tests for significance of coefficients. Note that the tests are valid only if flexmix returned the maximum likelihood estimator of the parameters.

References

Friedrich Leisch. FlexMix: A general framework for finite mixture models and latent class regression in R. Journal of Statistical Software, 11(8), 2004. http://www.jstatsoft.org/v11/i08/

Examples

Run this code
data(NPreg)
ex1 <- flexmix(yn~x+I(x^2), data=NPreg, k=2)
ex1r <- refit(ex1)

## in one component all coefficients should be highly significant,
## in the other component only the linear term
summary(ex1r)

Run the code above in your browser using DataLab