Skip to contents

Returns raw / standardised / externally studentised residuals along with normality, heteroskedasticity (Breusch-Pagan), and autocorrelation (Durbin-Watson) tests. Optionally also returns deviance and Pearson residuals for logistic / Poisson GLMs.

Usage

compute_residuals(y, y_hat, X, model_type = "linear")

Arguments

y

Observed response.

y_hat

Fitted values.

X

Design matrix.

model_type

"linear", "logistic", or "poisson".

Value

A morie_residual_diagnostics list.