nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
116 stars 45 forks source link

Question/Documentation Request: How are output columns calculated in the presence of censoring? #545

Closed billdenney closed 3 years ago

billdenney commented 3 years ago

I have mouse tumor growth data that I am modeling. With it, I have low censoring (<1 mm^3 is considered censored) and high censoring (after euthanasia, the tumor is bigger than it was at euthanasia).

It's not exactly clear to me how the output columns are calculated in censored results. Is this documented somewhere, and is there a better way to calculate them?

What I think I'm seeing based on the outputs in my model are:

I would have thought that the following would be the column outputs

mattfidler commented 3 years ago

Since the censoring support is closer to monolix, the outputs are closer to monolix as well. I started writing a vignette about it.

The paragraph that may answer your question is

For censored data output, it is often useful to see how the predictions perform in the censored area. To accomplish this, a simulated value is used to show the prediction and noise. This is then used to calculate the standard residual values in nlmixr. By default, this value is simulated from a truncated normal distrubtion under the model assumptions and the censoring information specified in the data (though you can use the CDF method used in the npde package instead if you are calculating npdes as well). This simulated value replaces the original DV and then used to calculate all the residuals requested. The original limit information will be output in lowerLim and upperLim.

billdenney commented 3 years ago

Thanks! That does answer my question.