Page 1 of 1

Multivariate Models: mixture y1: Normal and y2: Poisson

Posted: Wed Jul 08, 2020 1:53 pm
by amoretti
Hello everyone,

I want to estimate a multilevel mixed type model: y1 is Normal and y2 is Poisson.

I’m using the following code:

model= c(y1, log(y2)) ~ 1 + x1 + (1 | group) + (1[1] | idn )
mymodel3 <- runMLwiN( model, D = c("Mixed", "Normal", "Poisson"),
estoptions = list(EstM = 0, resi.store=TRUE),
data = sample).

I obtain the following error:
"error while obeying batch file wrong number of output columns
.
Execution completed

Error in foreign::read.dta(resifile) :
unable to open file: 'No such file or directory' "

Do you know what's going on?
Thanks.

Angelo

Re: Multivariate Models: mixture y1: Normal and y2: Poisson

Posted: Thu Jul 09, 2020 2:04 pm
by ChrisCharlton
This appears to be a bug in R2MLwiN. If you remove or comment out lines 1469-1475 in https://github.com/rforge/r2mlwin/blob/ ... ite.IGLS.R, i.e.:

Code: Select all

    if (level == 2 & D[[1]][1] == "Mixed") {
      for (i in 2:length(D)) {
        if (D[[i]][1] == "Binomial" | D[[i]][1] == "Poisson") {
          len.rpx <- len.rpx + 1
        }
      }
    }
then it appears to work correctly.

I have attached a source version of the R2MLwiN package where I have made this change.