Artificial Example for Normal Regression
A simple artificial regression example with 3 latent classes, two independent variables, one concomitant variable and a dependent variable which follows a Gaussian distribution.
data("NregFix")A data frame with 200 observations on the following 5 variables.
x1Independent variable: numeric variable.
x2Independent variable: a factor with two levels:
0 and 1.
wConcomitant variable: a factor with two levels:
0 and 1.
yDependent variable.
classLatent class memberships.
data("NregFix", package = "flexmix")
library("lattice")
xyplot(y ~ x1 | x2 * w, data = NregFix, groups = class)
Model <- FLXMRglmfix(~ 1, fixed = ~ x2,
nested = list(k = c(2, 1),
formula = c(~x1, ~0)))
fittedModel <- initFlexmix(y ~ 1, model = Model, data = NregFix, k = 3,
concomitant = FLXPmultinom(~ w), nrep = 5)
fittedModelPlease choose more modern alternatives, such as Google Chrome or Mozilla Firefox.