ols_prep_dfbeta_data {olsrr}R Documentation

DFBETAs plot data

Description

Prepares the data for dfbetas plot.

Usage

ols_prep_dfbeta_data(d, threshold)

Arguments

d

A tibble or data.frame with dfbetas.

threshold

The threshold for outliers.

Examples

model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)
dfb <- dfbetas(model)
n <- nrow(dfb)
threshold <- 2 / sqrt(n)
dbetas  <- dfb[, 1]
df_data <- data.frame(obs = seq_len(n), dbetas = dbetas)
ols_prep_dfbeta_data(df_data, threshold)


[Package olsrr version 0.6.0 Index]