plot_res_vs_linear_predictor {asympDiag} | R Documentation |
Plot Residuals against Linear Predictor
Description
Plot Residuals against Linear Predictor
Usage
plot_res_vs_linear_predictor(
model,
residual_fn = stats::rstandard,
xlab = "Linear Predictor",
ylab = "Standardized deviance residuals",
...
)
Arguments
model |
|
residual_fn |
A function to calculate model residuals. The default is
|
xlab |
The label for the x-axis. Defaults to "Linear Predictor". |
ylab |
The label for the y-axis. Defaults to "Standardized deviance residuals". |
... |
Extra arguments to |
Details
If the model was fitted using the glm()
function, it will use the predict()
method with type = link
, otherwise, it will use the fitted()
method.
Value
An invisible list containing the linear predictor (x) and standardized deviance residuals (y).
Examples
fit <- lm(mpg ~ cyl, data = mtcars)
plot_res_vs_linear_predictor(fit)
plot_res_vs_linear_predictor(fit, residual_fn = rstudent)
plot_res_vs_linear_predictor(fit, residual_fn = residuals)
glm_fit <- glm(cyl ~ mpg, family = poisson(), data = mtcars)
plot_res_vs_linear_predictor(glm_fit)
plot_res_vs_linear_predictor(glm_fit, type = "pearson")
[Package asympDiag version 0.3.1 Index]