Hello All,
I have a data frame called train.data which has 100 columns. I am using an
statistical package to learn a model and the format of using that package is as
follows:
ex5 <- stepFlexmix(cbind(y,1-y)~x|id2, data=NPreg, k=2,
model=FLXMRglm(family="binomial"), nrep=5)
the first column of train.data contains the yvector and the rest is the x. I
have used paste as follows to do cbind(y,1-y)~x but I am not sure how I can use
that to do the | id2 part:
x = paste(colnames(train.data[,4:91]), collapse = "+")
mm <- as.formula(paste("cbind(train.data[,1],1-train.data[,1]) ~ ",
x))
but I would like to have "|" colnames(train.data[,3]) at the end which
would be "| id2" in the above example. First of all, when I do
colnames for my third column (colnames(train.data[,3])) I get NULL which I dont
why, because colnames(train.data) works perfectly fine.
Second of all, how should I add that part to my formula?
Thanks a lot,Andra
[[alternative HTML version deleted]]