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_pointgeomGuestLineAttributesA
listof arguments passed toggplot2::geom_functionto display guest criteria.geomComparisonLineAttributesA
listof arguments passed toggplot2::hlineorggplot2::ablineto display comparison lines.geomLLOQAttributesA
listwith arguments which are passed on to the callggplot2::geom_hlineaddRegressionA boolean that activates the insertion of a regression line.
deltaGuestNumeric value parameter for the Guest function.
labelGuestCriteriaLabel used in the legend for guest criteria (default: "guest criteria").
xScaleArgslist of arguments passed to
ggplot2::scale_x_continuous()orggplot2::scale_x_log10()yScaleArgslist of arguments passed to
ggplot2::scale_y_continuous()orggplot2::scale_y_log10()
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()