I seem to have found a bug in monolix2simulx when it comes to 1) having multiple columns in the data set defined as regressors AND 2) one or more of those columns containing missing values "." - if those regressor columns with missing values do not come before the regressor columns without missing values.
Specific case:
My data set in Monolix includes 3 regressors:
Ordered: X1, X2, X3
X2 contains missing values, set to "."
X1 and X3 do not contain missing values
When I run monolix2simulx, I get the following error:
The error appears to occur in readDatamlx specifically from for (k in (ix.num)) on line 489 and Sx[,ix.num[k]] on line 490.
ix.num is a named vector. In my case, ix.num has name = X2 and value = 2.
Thus, k = 2 (rather than X2, which would be the column name and is likely the intention) and the call ix.num[2] = NA, which throws the error.
It is possible to work-around this error by reordering the regressors in the original dataset to {X2,X1,X3}, such that the regressor, X2, with missing values (or all such regressors) come first - I have confirmed this as a work-around.
https://github.com/MarcLavielle/mlxR/blob/3b2609375ef9f32841e9ec49ac4a49e79869ced3/R/readdatamlx.R#L484-L490
Hi Marc,
I seem to have found a bug in monolix2simulx when it comes to 1) having multiple columns in the data set defined as regressors AND 2) one or more of those columns containing missing values "." - if those regressor columns with missing values do not come before the regressor columns without missing values.
Specific case:
My data set in Monolix includes 3 regressors:
When I run monolix2simulx, I get the following error:
The error appears to occur in
readDatamlx
specifically fromfor (k in (ix.num))
on line 489 andSx[,ix.num[k]]
on line 490.It is possible to work-around this error by reordering the regressors in the original dataset to {X2,X1,X3}, such that the regressor, X2, with missing values (or all such regressors) come first - I have confirmed this as a work-around.
It would, however, be great to get a bug fix.
Thanks,
James