openpharma / crmPack

Object-Oriented Implementation of CRM Designs
https://openpharma.github.io/crmPack/
20 stars 10 forks source link

Remove extraneous warning message when fitting `LogisticLogNormalOrdinal` models #748

Open Puzzled-Face opened 10 months ago

Puzzled-Face commented 10 months ago

When fitting LogisticLogNormalOrdinal models

d <- .DefaultDataOrdinal()
m <- .DefaultLogisticLogNormalOrdinal()
o <- .DefaultMcmcOptions()

samples <- mcmc(d, m, o)

a warning message is issued.

Warning in rjags::jags.model(file = model_file, data = model_data, inits =
c(model_inits, : Unused variable "y" in data

This is expected, and is a consequence of the transformation of the y slot in DataOrdinal (a one dimensional vector of toxicity grades) to the matrix of indicator variables that is actually used in the JAGS model.

End users may find the warning confusing. Ideally, it should be prevented, removed or suppressed.

To do

danielinteractive commented 7 months ago

I think we can just remove "y" from https://github.com/Roche/crmPack/blob/main/R/Model-class.R#L3405. If that does not work, you can assign y to another variable inside the JAGS code to make JAGS happy.

danielinteractive commented 3 weeks ago

@Puzzled-Face did you try my suggestions already?