Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sim_blq read in correctly for Monolix 2019R2, 2020R1 and 2022R2 but not used in any of the plots #255

Open
biencan1 opened this issue Aug 25, 2022 · 8 comments · Fixed by #365
Assignees
Labels
bug Something isn't working

Comments

@biencan1
Copy link

biencan1 commented Aug 25, 2022

In Monolix 2019R2, 2020R1 and 2022R2 there are no issues with reading in sim_blq data, but they are not used in plotting to substitute DV values for censored data.

Example code run after creating controller:

ctr %>% pmx_plot_iwres_ipred (bloq=pmx_bloq(cens="BLOQ",colour="blue",size=1),
                              strat.facet = ~TRT,
                              use.abbrev = TRUE,
                              is.draft=FALSE,
                              facets=list(scales="free_x",nrow=1),
                              labels = list(title = "IWRES vs IPRED by dose"))

Produces following plot:
image

While the plot should look more like this:
image

When checking the controller the simulated values seem to be loaded fine but under “bloq”: type NULL and value reads “Pairlist of length 0” (see snapshot below). Is that correct?
image

ggPMX 1.2.8 was used using following R-module: R 4.1.0 Base.

Monolix run outputs and R scripts available to recreate the issue

@tynsci tynsci added the bug Something isn't working label Sep 29, 2022
@tynsci tynsci self-assigned this Sep 29, 2022
@tynsci
Copy link
Collaborator

tynsci commented Nov 2, 2022

  • it has been possible to reproduce the bug
  • debugging in progress

@tynsci
Copy link
Collaborator

tynsci commented Nov 2, 2022

@biencan1

Data substition for simulated BLOQ

  • data substition for IWRES vs IPRED plot would be based on the following logic:
    • IWRES=ifelse(as.logical(BLOQ), iwRes_mode_simBlq, IWRES)

Resulting Plot

iwres_sim_blq

Next

  • implement code change in a pull request

@tynsci
Copy link
Collaborator

tynsci commented Nov 3, 2022

@biencan1

Assumptions

  • npde, iwres and pwres data are the data types which may need to be copied from simulations
  • these data types are available with "_mode" suffix
    • should "mean" ever be used, or would it be available, if so, how should a choice between mean and mode be made: a new parameter?

Challenges

  • there appears to be no data in the package under inst which allows this to be tested (no [iwRes,pwRes,npde]_mode_simBlq columns)

@biencan1
Copy link
Author

biencan1 commented Nov 3, 2022

I suggest to use the mode_simBlq only (without giving the choice between the mean and the mode). However, it should be made clear in the documentation that the mode_simBlq is used.

@baltcir1
Copy link
Collaborator

baltcir1 commented May 4, 2023

sim_blq still doesn't work.

@mattfidler
Copy link
Collaborator

Not fixed by #365

@mattfidler
Copy link
Collaborator

First issue with BLQ

This is hard coded in the yaml file:

y_simBlq_mode: y_simBlq_mode

It shouldn't be. It is based on endpoint, and should match what you are pulling in for the endpoint. The default should be y which is the typical endpoint for monolix single endpoint models (though in truth this can be arbitrary and is for models coming from other sources like babelmixr2 or edited manually).

Second issue with BLQ

Currently the DVs are not replaced with the simulated values; Currently it actually replaces the DV with nothing. The default DV is still the LLOQ value which was in the input dataset, and doesn't match the simulated BLQ dataset from the monolix files.

@mattfidler
Copy link
Collaborator

@tynesjo if you need to have some screen sharing we can show you what the issue is and which columns you need to grab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants