powered by
Extract fitted values for each component from a flexmix object.
# S4 method for flexmix fitted(object, drop = TRUE, aggregate = FALSE, ...)
an object of class "flexmix" or "FLXR"
"flexmix"
"FLXR"
logical, if TRUE then the function tries to simplify the return object by combining lists of length 1 into matrices.
TRUE
logical, if TRUE then the fitted values for each model aggregated over the components are returned.
currently not used
Friedrich Leisch and Bettina Gruen
data("NPreg", package = "flexmix") ex1 <- flexmix(yn ~ x + I(x^2), data = NPreg, k = 2) matplot(NPreg$x, fitted(ex1), pch = 16, type = "p") points(NPreg$x, NPreg$yn)
Run the code above in your browser using DataLab