plot_pseudobeta | R Documentation |
This function decomposes a PLS-Cox model, translating it into a pseudo-beta interpretation with respect to the original variables. The decomposition is based on the relationship between the Cox coefficients associated with each component and the weights corresponding to the original variables. The final Cox formula is thus expressed in terms of these original variables.
plot_pseudobeta(
model,
error.bar = TRUE,
onlySig = FALSE,
alpha = 0.05,
zero.rm = TRUE,
top = NULL,
auto.limits = TRUE,
selected_variables = NULL,
show_percentage = TRUE,
size_percentage = 3,
title = NULL,
title_size_text = 15,
subtitle = NULL,
subtitle_size_text = 12,
legend.position = "right",
legend_size_text = 12,
x_axis_size_text = 10,
y_axis_size_text = 10,
label_x_axis_size = 10,
label_y_axis_size = 10
)
model |
Coxmos model. |
error.bar |
Logical. Show error bar (default: TRUE). |
onlySig |
Logical. Compute pseudobetas using only significant components (default: FALSE). |
alpha |
Numeric. Numerical values are regarded as significant if they fall below the threshold (default: 0.05). |
zero.rm |
Logical. Remove variables with a pseudobeta equal to 0 (default: TRUE). |
top |
Numeric. Show "top" first variables with the higher pseudobetas in absolute value. If top = NULL, all variables are shown (default: NULL). |
auto.limits |
Logical. If "auto.limits" = TRUE, limits are detected automatically (default: TRUE). |
selected_variables |
Character. Name of survival model variables to performed a custom selection (default: NULL). |
show_percentage |
Logical. If show_percentage = TRUE, it shows the contribution percentage for each variable to the full model (default: TRUE). |
size_percentage |
Numeric. Size of percentage text (default: 3). |
title |
Character. Plot title (default: NULL). |
title_size_text |
Numeric. Text size for title (default: 15). |
subtitle |
Character. Plot subtitle (default: NULL). |
subtitle_size_text |
Numeric. Text size for subtitle (default: 12). |
legend.position |
Character. Legend position. Must be one of the following: "top", "bottom", "right" or "left (default: "right"). |
legend_size_text |
Numeric. Text size for legend title (default: 12). |
x_axis_size_text |
Numeric. Text size for x axis (default: 10). |
y_axis_size_text |
Numeric. Text size for y axis (default: 10). |
label_x_axis_size |
Numeric. Text size for x label axis (default: 10). |
label_y_axis_size |
Numeric. Text size for y label axis (default: 10). |
The plot_pseudobeta
function offers a comprehensive visualization and interpretation
of a PLS-Cox model in terms of the original variables. The function begins by validating the model's
class and type. For single block models, the function computes the pseudo-betas by multiplying
the loading weights (W.star
) with the Cox coefficients. For multiblock models, this computation
is performed for each block separately.
The function provides flexibility in terms of visualization. Users can opt to display error bars,
filter out non-significant components based on a significance threshold (alpha
), and remove
variables with a pseudo-beta of zero. Additionally, the function allows for automatic limit
detection for the plot and displays the contribution percentage of each variable to the full model.
The resulting plot can be customized further with various text size parameters for different plot
elements.
It's worth noting that the function supports both single block and multiblock PLS-Cox models. For multiblock models, the function returns a list of plots, one for each block, whereas for single block models, a single plot is returned.
NOTE: For splsicox
, the pseudobeta function provides an approximation rather than the actual
coefficients for the original variables. This is because splsicox
requires a deflation process,
making it impossible to compute a real \( W^* \) vector.
A list containing the following elements:
plot
: Depending on the model type, this can either be a single ggplot object visualizing
the pseudo-beta coefficients for the original variables in a single block PLS-Cox model, or a list
of ggplot objects for each block in a multiblock PLS-Cox model. Each plot provides a comprehensive
visualization of the pseudo-beta coefficients, potentially including error bars, significance filtering,
and variable contribution percentages.
mb_plot
: Only when multi-block model type is used. This is a single ggplot object visualizing
the pseudo-beta coefficients for the original variables for all omics simultaneously. The plot provides a
comprehensive visualization of the pseudo-beta coefficients, potentially including error bars, significance
filtering, and variable contribution percentages.
beta
: A matrix or list of matrices (for multiblock models) containing the computed pseudo-beta coefficients for the original variables. These coefficients represent the influence of each original variable on the survival prediction.
sd.min
: A matrix or list of matrices (for multiblock models) representing the lower bounds of the error bars for the pseudo-beta coefficients.
sd.max
: A matrix or list of matrices (for multiblock models) representing the upper bounds of the error bars for the pseudo-beta coefficients.
Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es
data("X_proteomic")
data("Y_proteomic")
X <- X_proteomic[,1:50]
Y <- Y_proteomic
splsicox.model <- splsicox(X, Y, n.comp = 2, penalty = 0.5, x.center = TRUE, x.scale = TRUE)
plot_pseudobeta(model = splsicox.model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.