Learn R Programming

auditor (version 1.3.5)

plotD3_halfnormal: Plot Half-Normal in D3 with r2d3 package.

Description

The half-normal plot is one of the tools designed to evaluate the goodness of fit of a statistical models. It is a graphical method for comparing two probability distributions by plotting their quantiles against each other. Points on the plot correspond to ordered absolute values of model diagnostic (i.e. standardized residuals) plotted against theoretical order statistics from a half-normal distribution.

Usage

plotD3_halfnormal(object, ..., quantiles = FALSE, sim = 99, scale_plot = FALSE)

plotD3HalfNormal(object, ..., quantiles = FALSE, sim = 99, scale_plot = FALSE)

Value

a r2d3 object

Arguments

object

An object of class 'auditor_model_halfnormal' created with model_halfnormal function.

...

Other 'auditor_model_halfnormal' objects.

quantiles

If TRUE values on axis are on quantile scale.

sim

Number of residuals to simulate.

scale_plot

Logical, indicates whenever the plot should scale with height. By default it's FALSE.

See Also

model_halfnormal

score_halfnormal, plot_halfnormal

Examples

Run this code
dragons <- DALEX::dragons[1:100, ]

# fit a model
model_lm <- lm(life_length ~ ., data = dragons)

lm_audit <- audit(model_lm, data = dragons, y = dragons$life_length)

# validate a model with auditor
hn_lm <- model_halfnormal(lm_audit)

# plot results
plotD3_halfnormal(hn_lm)

Run the code above in your browser using DataLab