Plots predicted vs observed data, grouped by "group".
This function visualizes the relationship between predicted and observed values, allowing for easy identification of discrepancies.
Usage
plotPredictedVsObserved(
plotData,
metaData = NULL,
mapping = ggplot2::aes(),
yUnit = NULL,
xyScale = "log",
predictedAxis = "y",
comparisonLineVector = ospsuite.plots::getFoldDistanceList(folds = c(2)),
...
)Arguments
- plotData
An object of class
DataCombinedor adata.table. If adata.table, it must include the following:xValues: Numeric time points.yValues: Observed or simulated values (numeric).group: Grouping variable (factor or character).name: Name for the dataset (factor or character).xUnit: Unit of the x-axis values (character).yUnit: Unit of the y-axis values (character).dataType: Specifies data type—eitherobservedorsimulated.Optional:
yErrorType: Type of y error, relative toospsuite::DataErrorType.yErrorValues: Numeric error values.yMin,yMax: Custom ranges for y-axis instead of error types.IndividualId: Used for aggregation of simulated population data.
- metaData
A list containing metadata for the plot. If NULL, a default list is constructed from the data. Expected structure includes information about dimensions and units for both x and y axes.
- mapping
A ggplot2 aesthetic mapping object. Default is
ggplot2::aes(). This is added or replaces the default mapping constructed by the data.- yUnit
A character string specifying the target unit for the x and y-axis. If
NULL(default), the most frequent unit in the data is used. For available units, seeospsuite::ospUnits.- xyScale
A character string specifying the scale for the x and y-axis. Default is
log.- predictedAxis
A character string specifying which axis to use for predicted values. Options are
"x"(predicted on x-axis, observed on y-axis) or"y"(default, predicted on y-axis, observed on x-axis).- comparisonLineVector
A named list generated by the function
ospsuite.plots::getFoldDistanceList. This list contains fold distances, where each entry represents a fold and its reciprocal. The identity fold (1) will be included if specified ingetFoldDistanceList.- ...
Arguments passed on to
ospsuite.plots::plotYVsXgeomPointAttributesA
listwith arguments which are passed on to the callggplot2::geom_pointgeomComparisonLineAttributesA
listof arguments passed toggplot2::hlineorggplot2::ablineto display comparison lines.geomLLOQAttributesA
listwith arguments which are passed on to the callggplot2::geom_hlinegroupAestheticsA character vector of aesthetic names used for grouping data points when calculating comparison statistics. Data will be grouped by combinations of these aesthetics before computing counts and proportions within comparison lines. Common grouping aesthetics include
"colour","fill","shape".addRegressionA boolean that activates the insertion of a regression line.
xScaleeither 'linear' then
ggplot2::scale_x_continuous()or 'log' thenggplot2::scale_x_log10()is usedxScaleArgslist of arguments passed to
ggplot2::scale_x_continuous()orggplot2::scale_x_log10()yScaleeither 'linear' then
ggplot2::scale_y_continuous()or 'log' thenggplot2::scale_y_log10()is used
Value
A ggplot2 plot object representing predicted vs observed values,
including aesthetics for the x and y axes.
See also
Other plot functions based on ospsuite.plots:
plotQuantileQuantilePlot(),
plotResidualsAsHistogram(),
plotResidualsVsCovariate(),
plotTimeProfile()