# asVPC.distanceW: calculate percentiles of original data using distance-related... In asVPC: Average Shifted Visual Predictive Checks

## Description

calculate percentiles of original data using distance-related weight percentiles of simulated data with corresponding confidence interval

## Usage

 ```1 2 3 4``` ```asVPC.distanceW(orig.data, sim.data, n.timebin, n.sim, n.hist, q.list = c(0.05, 0.5, 0.95), conf.level = 0.95, X.name = "TIME", Y.name = "DV", opt.DV.point = FALSE, weight.flag = FALSE, Y.min = NULL, Y.max = NULL, only.med = FALSE, plot.flag = TRUE) ```

## Arguments

 `orig.data` the original data for model fitting `sim.data` the simulated data from NONMEM `n.timebin` the number of bin in X axis `n.sim` the number of simulation in the simulated data `n.hist` the number of shifted `q.list` numeric vector of probabilities with values in [0,1] `conf.level` confidence level of the interval `X.name` the name of X variable in the original scatter plot `Y.name` the name of Y variable in the original scatter plot `opt.DV.point` option to put data point in the plot `weight.flag` option to use weight in average shifted calculation `Y.min` minimum of Y range in the plot `Y.max` maximum of Y range in the plot `only.med` option to use only median `plot.flag` TRUE: drawing plot / FALSE: generate data for drawing plot

## Value

plot or the values to draw plot

## Author(s)

Eun-Kyung Lee lee.eunk@gmail.com

## References

new paper...

`asVPC.binW`
 ```1 2 3``` ```data(origdata) data(simdata) asVPC.distanceW(origdata,simdata,n.timebin=10, n.sim=100,n.hist=3) ```