Open billdenney opened 5 years ago
Hi @billdenney
This should be doable; However, to me I don't know if it is a vpc
any longer.
To me you simply need to:
getData
) and do the data modifications suggested above and then send it to the simulate
routine. You could also simply add the variability to make a prediction interval of sorts.nlmixr
simulation engine.ggplot2
it would be simple to add the data on top of the new plot.I will keep it on a feature request list. I am also open to pull requests.
With RxODE
FOCB
First observation carried backward = NOCB
next observation carried backward. You would simply have to insert NA
on these new observations and can apply this without any more modifications.
For multiple endpoints, the vpc
already works, so simply extracting the vpc
RxODE model should suffice. The new data is the key.
You can also use locf
with RxODE
This is something that I often struggle with because I tend to dislike automatic binning algorithms (I do understand that it's hard to automatically make bins good). And, to me, this is taking the concept of VPC from a discrete, binned group which could have bias at bin corners to a continuous unbinned group (since every subject has every independent variable observation, it is technically binned at all unique values). To me, it is like going from 8- to 64-bit in processing-- still the same thing in concept, but you can do a lot more.
My fingers are crossed that I'll be able to make a PR for it. (But I won't be foolish and promise a time scale for that.)
Thanks for the RxODE pointers which will help with implementation.
I also dislike binning.
I suppose that my solution didn't even include it (whoops)
If you want to go to a low level information, each nlmixr object has $simInfo
which has the RxODE model, data, and options needed to continue.
One note -- augPred
acutally may already do this with data; Perhaps it is closer to being complete. Now have to separate into another function.
One of the features that I always want to overcome with VPCs is the discretized nature of the independent variable axis. It has historically been limited by the fact that simulations are performed on the basis of the original dataset rather than an augmented dataset. I have always interpreted the reason for this as simplicity: Running a VPC on the original dataset is easier than generating a new one, running the simulation on that, and then summarizing.
With that preamble...
Summary: At least for the single-endpoint model, I think that an expanded VPC dataset would improve the visualizations and precision of VPCs. For multi-endpoint models, that may become difficult or (near) impossible to include all endpoints.
I would love it if
nlmixr
would have an option to expand the dataset so that all individuals have all independent variable values. (For example, with actual time post dose, some subjects will have samples at 0.99, 1, and 1.01 hours-- so, ensure that all subjects have all three of those time points.)There are some complexities that immediately come to mind: