plot.replext_gls | R Documentation |
This method creates a ggplot2 visualization of results from a replext_gls object. It allows for flexible plotting of different metrics across various conditions.
## S3 method for class 'replext_gls'
plot(
x,
term,
metric = "rejection_rates",
x_axis = "tppp",
color = "rho",
title = NULL,
x_label = NULL,
y_label = NULL,
...
)
x |
An object of class "replext_gls", typically the output from replext_gls(). |
term |
Character. The name of the model term to plot. |
metric |
Character. The metric to plot on the y-axis. Default is "rejection_rates". Other options include "mean_estimates", "mean_bias", etc. |
x_axis |
Character. The variable to plot on the x-axis. Default is "tppp" (time points per phase). |
color |
Character. The variable to use for color grouping. Default is "rho" (autocorrelation parameter). |
title |
Character. The plot title. If NULL, a default title is generated. |
x_label |
Character. The x-axis label. If NULL, a default label is generated. |
y_label |
Character. The y-axis label. If NULL, a default label is generated. |
... |
Pass extra arguments to ggplot. |
This method creates a line plot with points, where each line represents a different level of the color variable (default is rho). If the metric is "rejection_rates", error bars are added to represent the standard error of the rejection rates.
A ggplot2 object representing the plot.
results <- replext_gls(
n_timepoints_list = c(10),
rho_list = c(0.2),
iterations = 10,
betas = c("(Intercept)" = 0, "phase1" = 1),
formula = y ~ phase
)
plot(results, term = "phase1", metric = "rejection_rates")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.