| predscor | R Documentation |
Computes the correlations between the prediction terms in a regression fit, and displays them graphically in a way that takes the standard deviations of the prediction terms into account. The input variables of the regression can be numerical, categorical, logical and character, and the regression model can be linear or generalized linear. The regression formula in lm or glm may contain transformations and interactions.
predscor(fit, maxnpreds = 8, sort.by.stdev = TRUE, adj.order = FALSE,
cell.length = "stdev", plot.abs.cor = FALSE, palette = NULL,
diagonalcolor = "black")
fit |
an output object of |
maxnpreds |
the maximal number of prediction terms to plot. When there are more prediction terms than this, those with smallest standard deviations are combined. |
sort.by.stdev |
if |
adj.order |
if |
cell.length |
if " |
plot.abs.cor |
if |
palette |
a vector with colors to display
correlations ranging from -1 to 1.
If |
diagonalcolor |
color of the cells on the diagonal of the correlation matrix. The default is "black". |
A list containing
cormat |
the correlation matrix of the prediction terms. |
predterms |
matrix of cases by prediction terms. |
predsummary |
data frame with the standard deviation of each prediction term and the total linear prediction. |
Rousseeuw, P.J.
Rousseeuw, P.J. (2025). Explainable Linear and Generalized Linear Models by the Predictions Plot https://arxiv.org/abs/2412.16980v2 (open access).
predsplot
data(data_titanic)
attach(data_titanic)
Pclass = factor(Pclass, unique(Pclass))
Sex = factor(Sex, labels = c("F","M"))
fit <- glm(y ~ Sex + Age + SibSp + Parch + Pclass, family=binomial)
predscor(fit)
# For more examples, we refer to the vignette:
## Not run:
vignette("predsplot_examples")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.