# \donttest{
require(magrittr)
vpc <- observed(obs_data, x=TIME, y=DV) %>%
simulated(sim_data, y=DV) %>%
censoring(blq=(DV < 50), lloq=50) %>%
binning(bin = "pam", nbins = 5) %>%
vpcstats()
#Using LLOQ variable in data with different values of LLOQ by Study:
obs_data$LLOQ <- obs_data[, ifelse(STUDY == "Study A", 50, 25)]
vpc <- observed(obs_data, x=TIME, y=DV) %>%
simulated(sim_data, y=DV) %>%
censoring(blq=(DV < LLOQ), lloq=LLOQ) %>%
stratify(~ STUDY) %>%
binning(bin = "kmeans", nbins = 4) %>%
vpcstats()
# }
Run the code above in your browser using DataLab