plot_coef.Rd
This function creates a bar plot to visualize regression coefficients, with optional ordering, intercept removal, and coefficient selection.
plot_coef(
coefficients,
remove_intercept = FALSE,
order_coef = TRUE,
select = NULL,
title = "Regression Coefficients"
)
A named vector or data frame of regression coefficients.
Logical. If TRUE, the intercept (first row) will be removed from the plot (default: FALSE).
Logical. If TRUE, the coefficients will be sorted by absolute value before plotting (default: TRUE).
A logical vector to specify which coefficients are selected. If provided, the plot will highlight selected coefficients (default: NULL).
A character string specifying the title of the plot (default: "Regression Coefficients").
A ggplot object displaying the regression coefficients as a bar plot.
This function takes regression coefficients and creates a horizontal bar plot. It allows for sorting by the absolute value of coefficients, removing the intercept, and highlighting selected coefficients if a logical vector is provided. The plot is useful for interpreting regression models.