View source: R/model_selection.R
plot_r2 | R Documentation |
Plots regression model r-squared vs. model size (number of variables).
plot_r2( pve_list, model_names = NULL, line_color = "gray50", line_alpha = 0.5, line_type = "dashed", line_size = 1.5, point_color = NULL, palette = "Paired", point_alpha = 1, point_shape = 16, point_size = 5, label_size = 5, label_line_size = 0.75, label_line_alpha = 0.5, title = NULL, x_title = "Model complexity (no. of variables)", y_title = "Variance explained", legend_title = NULL, legend_position = "right", xlim_multiplier = 0.25, ylim_multiplier = 0.25 )
pve_list |
A list of lists containing regression model information. Each list must have the same element ordering, and the following elements and corresponding names are required:
|
model_names |
A vector of model names that follows the same ordering as the lists in
|
line_color |
A string for the line color between points. |
line_alpha |
A numeric for the line alpha value. |
line_type |
A string for the line type between points. |
line_size |
A numeric for the line size between points. |
point_color |
A vector of colors corresponding to the groups of points (r2 vs adjusted r2). If not specified, default colors from a color palette will be used. |
palette |
A string corresponding to a color palette from which point colors are chosen. |
point_alpha |
A numeric for the point alpha value. |
point_shape |
A numeric for the point shape. |
point_size |
A numeric for the point size. |
label_size |
A numeric for the label text size.. |
label_line_size |
A numeric for the line thickness of the guide line from the label text to its corresponding point. |
title |
Plot title. |
x_title |
X-axis title. |
y_title |
Y-axis title. |
legend_title |
Legend title. |
xlim_multiplier |
A numeric constant used to increase or decrease the x-axis range. |
ylim_multiplier |
A numeric constant used to icnrease or decrease the y-axis range. |
label_line_alpha. |
A numeric for the line alpha value of the guide line from the label text to its corresponding point. |
Creates a scatterplot showing the tradeoff between variance explained of the outcome
(e.g., gene expression) and model complexity. This function is designed to be a visualization
helper function for the output from get_matrix_r2
. It allows for the plotting of only r2, only
adjusted r2, or both.
A ggplot object.
get_matrix_r2
get_residual_matrix
get_design_mat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.