Function to plot the coverage of the Numerical Predictive Check
Source:R/npc.coverage.R
npc.coverage.RdThis function takes the output from the npc command in Perl Speaks
NONMEM (PsN) and makes a coverage plot. A coverage plot for the NPC looks
at different prediction intervals (PIs) for each data point and calculates
the total number of data points in the data set lying outside of these PIs.
The plot shows the relative amount of data points outside of their PI
compared to the expected amount at that PI. In addition a confidence
interval around these values are computed based on the simulated data.
Usage
npc.coverage(
npc.info = "npc_results.csv",
main = "Default",
main.sub = NULL,
main.sub.cex = 0.85,
...
)Arguments
- npc.info
The results file from the
npccommand in PsN. For example,npc_results.csv, or if the file is in a separate directory./npc_dir1/npc_results.csv.- main
A string giving the plot title or
NULLif none."Default"creates a default title.- main.sub
Used for names above each plot when using multiple plots. Should be a vector
c("Group 1","Group 2")- main.sub.cex
The size of the
main.subtitles.- ...
Other arguments passed to
xpose.multiple.plot.default,xyplotand others. Please see these functions (and below) for more descriptions of what you can do.
Additional arguments for the NPC coverage plots
Additional plot features
CISpecifies whether confidence intervals (as lines, a shaded area or both) should be added to the plot. Allowed values are:
"area","lines","both", orNULL.mark.outside.dataShould the points outside the CI be marked in a different color to identify them. Allowed values are
TRUEorFALSE.ablineShould there be a line to mark the value of y=1? Possible values are
TRUE,FALSEandNULL.
Line and area control. See plot,
grid.polygon and xyplot for more
details.
CI.area.colColor of the area for the CI. Defaults to
"blue"CI.area.alphaTransparency of the
CI.area.col. Defaults to 0.3.ab.lwdThe width of the abline. Default is 1.
ab.ltyLine type of the abline. Default is
"dashed"CI.upper.ltyLine type of the line at the upper edge of the CI.
CI.upper.colColor of the line at the upper edge of the CI.
CI.upper.lwdThe line width of the line at the upper edge of the CI.
CI.lower.ltyThe line type at the lower edge of the CI.
CI.lower.colThe color of the line at the lower edge of the CI.
CI.lower.lwdThe line width of the line at the lower edge of the CI.
obs.colThe color of the observed values.
obs.pchThe type of point to use for the observed values.
obs.ltyThe type of line to use for the observed values.
obs.typeThe combination of lines and points to use for the observed values. Default is
"b"for both.obs.cexThe size of the points to use for the observed values.
obs.lwdThe line width to use for the observed values.
out.colThe color of the observed values that lie outside of the CI. Only used if
mark.outside.data=TRUE.out.pchThe type of point to use for the observed values that lie outside of the CI. Only used if
mark.outside.data = TRUE.out.cexThe size of the points of the observed values that lie outside of the CI. Only used if
mark.outside.data = TRUE.out.lwdThe line width of the observed values that lie outside of the CI. Only used if
mark.outside.data = TRUE.
See also
read.npc.vpc.results
xpose.multiple.plot.default xyplot
Other PsN functions:
boot.hist(),
bootscm.import(),
randtest.hist(),
read.npc.vpc.results(),
read.vpctab(),
xpose.VPC(),
xpose.VPC.both(),
xpose.VPC.categorical(),
xpose4-package