-
Notifications
You must be signed in to change notification settings - Fork 29
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
Lines showing the percentiles for both the observations and the predictions #206
Comments
Hi, I believe that all of the plots in Figure S8 of the paper you reference can be created by xpose, which uses the VPC package. Please see: Best regards, |
I was a co-author on the MOEV paper and at the time the code of the paper was in the supplemental materials available online later on I co-wrote tidyvpc https://github.com/certara/tidyvpc (where all computation are efficiently done using data.table) tidyvpc is software agnostic just need an obstable and a simulation table |
Hi, Appologies for the delay in my response. The representation of the medians for the percentiles of the simulations is not yet implemented in library(xpose)
#> Loading required package: ggplot2
#>
#> Attaching package: 'xpose'
#> The following object is masked from 'package:stats':
#>
#> filter
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
## Compute the vpc data
xpdb_vpc <- vpc_data(xpdb_ex_pk, stratify = 'SEX', opt = vpc_opt(n_bins = 7, lloq = 0.1))
#>
#> VPC continuous --------------------
#> 1. Gathering data & settings
#> Using xpdb simulation problem 2 and observation problem 1.
#> Setting stratifying variable to SEX
#> Setting lloq to 0.1.
#>
#> 2. Computing VPC data
#> Configuring and initializing...
#> Stratifying oberved data...
#> Parsing observed data...
#> Filtering rows where EVID not 0
#> Parsing simulated data...
#> Filtering rows where EVID not 0
#> Binning: 0 0.66667 1.25 1.8 3 5 7 9
#> Calculating statistics for simulated data...
#> Calculating statistics for observed data...
#>
#> VPC done
## Extract the vpc data for use outside of the "conventional way"
special_df <- get_special(xpdb_vpc)
#> Returning vpc continuous data from $prob no.3
## Call the VPC function
vpc(xpdb_vpc) +
## Add your layer
geom_line(
data = special_df$vpc_dat,
aes(x = bin_mid, y = med, color = Simulations)) +
## Ensure consistent color scale
scale_color_manual(values = c('steelblue3', 'grey60', 'steelblue3'))
#> Warning: Removed 4 rows containing missing values (`geom_line()`).
#> Warning: Removed 25 rows containing missing values (`geom_point()`). Created on 2022-10-21 with reprex v2.0.2 |
According to the recommendations of the Model Evaluation Group of the International Society of Pharmacometrics (ISoP) Best Practice Committee (https://pubmed.ncbi.nlm.nih.gov/27884052/ ), it is suggested that a VPC should have lines showing the percentiles of both observations and predictions. This is important so the percentiles can be compared visually in order to compare the distribution of observed and predicted values. There is an illustration in the Figure S8 of the supplemental material.
If I checked correctly this is not possible yet in the package. My guess so far is that this functionality is available only in Monolix. Would it be possible to implement such functionality?
The text was updated successfully, but these errors were encountered: