I am trying to set up a mixture model using flex mix. I have a response
vector Y, a set of predictors X and grouping variables Z. When i try to run
flexmix i get the error below.Am i coding it wrong?

 fit1 <- flexmix(formula=Y~X|Z, data = data, k=3, cluster = NULL,
model=NULL, concomitant=NULL, control=list(class="Z"), weights=NULL)
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "flexmix", for signature
"formula", "data.frame", "numeric", "NULL", "NULL"


Thanks.

	[[alternative HTML version deleted]]

