indiv_plot | R Documentation |
Observations (DV), individual predictions (IPRED), and population predictions (PRED) plotted against the independent variable for each individual.
indiv_plot(
data,
x,
y,
ipred,
pred,
labels = gof_labels(),
ip_ncol = 4,
ip_nrow = 4,
scale_facet = "fixed",
labelfacet = "label_value",
strati1 = id,
strati2 = NULL,
color_color = c(dv = ggcertara::certara_pal()[1], outliers =
ggcertara::certara_pal()[2], ipred = ggcertara::certara_pal()[4], pred =
ggcertara::certara_pal()[7]),
fill_fill = c(ipred = ggcertara::certara_pal()[4]),
alpha_fill = 0.5,
line_linetype = c(dv = "blank", outliers = "blank", ipred = "solid", pred = "dashed"),
line_size = 1,
shape_shape = c(dv = 16, outliers = 10, ipred = NA, pred = NA),
shape_size = 1,
cwres.outliers = FALSE,
limit.outliers = 5,
uncertainty = FALSE,
uncert.ci = 0.95,
...
)
data |
A |
x |
The name of the independent variable column. Default value is "time". |
y |
The name of the dependent variable column. Default value is "dv". |
ipred |
The name of the individual prediction variable column. Default value is "ipred". |
pred |
The name of the population prediction variable column. Default value is "pred". |
labels |
A named |
ip_ncol |
Number of columns per plot. Default is 4. Adjust if encountering issues with incomplete first rows on the last page due to |
ip_nrow |
Number of rows per plot. Default is 4. Adjust similarly to |
strati1 |
The variable used to stratify the plots. Default is "id". |
strati2 |
An optional variable for an additional layer of stratification. Default is NULL. |
color_color |
A named vector specifying colors for different elements (dv, ipred, pred, outliers). Should be a vector of 4 colors. |
fill_fill |
A named vector specifying fill colors for elements when uncertainty is plotted. Specifically for 'ipred' when |
alpha_fill |
Transparency level for the filled area representing the confidence interval, when |
line_linetype |
A named vector specifying line types for different elements (dv, outliers, ipred, pred). |
line_size |
Line width for the line layer. Default is 1. |
shape_shape |
A named vector specifying shapes for different elements. When not specified, defaults are used. |
shape_size |
Size for the shape layer. Default is 1. |
cwres.outliers |
If |
limit.outliers |
Threshold for CWRES to identify outliers. Default is 5. |
uncertainty |
If |
uncert.ci |
Confidence interval level when |
... |
Additional arguments passed to lower-level functions. |
## Not run:
indiv_plot(data = dat,
x = "time",
y = "dv",
ipred = "ipred",
pred = "pred",
strati1 = "id",
ip_ncol = 3,
ip_nrow = 4,
uncertainty = FALSE)
## End(Not run)
# Example with individuals with high cwres values
## Not run:
indiv_plot(data = dat,
x = "time",
y = "dv",
ipred = "ipred",
pred = "pred",
strati1 = "id",
cwres.outliers = TRUE,
limit.outliers = 5,
ip_ncol = 3,
ip_nrow = 4,
uncertainty = FALSE)
## End(Not run)
# Example to apply layers with the ampersand sign & (example to change legend.position)
## Not run:
indiv_plot(data = dat,
x = "time",
y = "dv",
ipred = "ipred",
pred = "pred",
strati1 = "id") &
theme(legend.position = "bottom")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.