FLXMRglmfix | R Documentation |
This implements a driver for FlexMix which interfaces the glm
family of models and where it is possible to specify fixed (constant) or
nested varying coefficients or to ensure that in the Gaussian case the
variance estimate is equal for all components.
FLXMRglmfix(formula = . ~ ., fixed = ~0, varFix = FALSE, nested = NULL,
family = c("gaussian", "binomial", "poisson", "Gamma"),
offset = NULL)
formula |
A formula which is interpreted relative to the formula
specified in the call to |
fixed |
A formula which specifies the additional regressors for the fixed (constant) coefficients. |
varFix |
A logical indicating if the variance estimate for Gaussian components should be constrained to be equal for all components. It can be also a vector specifying the number of components with equal variance. |
nested |
An object of class |
family |
A character string naming a |
offset |
This can be used to specify an a priori known component to be included in the linear predictor during fitting. |
Returns an object of class FLXMRglmfix
inheriting from FLXMRglm
and FLXMRfix
.
Friedrich Leisch and Bettina Gruen
FLXMRglm
data("NPreg", package = "flexmix")
ex <- flexmix(yn ~ x | id2, data = NPreg, k = 2,
cluster = NPreg$class,
model = FLXMRglm(yn ~ . + I(x^2)))
ex.fix <- flexmix(yn ~ x | id2, data = NPreg,
cluster = posterior(ex),
model = FLXMRglmfix(nested = list(k = c(1, 1),
formula = c(~0, ~I(x^2)))))
summary(refit(ex))
## Not run:
summary(refit(ex.fix))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.