View source: R/utils_plotting.R
plot_regression | R Documentation |
Generates a point plot with for the fitted and outcome values for regression predictions with a fitted trend as an option.
plot_regression(
predx_object,
x_var = ".outcome",
y_var = ".fitted",
point_size = 2,
point_shape = 21,
point_color = "steelblue",
point_wjitter = 0.01,
point_hjitter = 0.01,
point_alpha = 0.75,
show_trend = TRUE,
trend_method = "lm",
show_calibration = TRUE,
line_size = 0.5,
plot_title = NULL,
plot_subtitle = NULL,
plot_tag = NULL,
x_lab = x_var,
y_lab = y_var,
cust_theme = ggplot2::theme_classic(),
...
)
predx_object |
a |
x_var |
name of the variable presented in the X axis. |
y_var |
name of the variable presented in the Y axis. |
point_size |
size of the plot points. |
point_shape |
shape of the points. |
point_color |
color of the data points. |
point_wjitter |
horizontal jittering of the points. |
point_hjitter |
vertical jittering of the points. |
point_alpha |
plot point alpha. |
show_trend |
logical, should a trend line be displayed? |
trend_method |
a method for fitting the trend line, see
|
show_calibration |
logical, should a line with slope 1 and intercept 1 be displayed in the plot? |
line_size |
size of the calibration or trend line. |
plot_title |
plot title. |
plot_subtitle |
plot subtitle. |
plot_tag |
plot tag, number of complete observations if not specified by the user. |
x_lab |
X axis title. |
y_lab |
Y axis title. |
cust_theme |
customized plot theme provided by the user. |
... |
extra arguments passed to |
The fitted trend is generated by geom_smooth
.
returns a ggplot object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.