Learn R Programming

devianLM (version 1.0.7)

get_devianlm_threshold: get_devianlm_threshold : Compute threshold using Monte Carlo simulations

Description

This package determines whether the maximum of the absolute values of the studentized residuals of a Gaussian regression is abnormally high. The distribution of the maximum of the absolute of the studentized residuals (depending on the design matrix) is computed via Monte-Carlo simulations (with n_sims simulations).

Usage

get_devianlm_threshold(
  x,
  n_sims = 50000,
  nthreads = detectCores() - 1,
  quant = 0.95
)

Value

Numeric value.

threshold

The quantile of order 1-alpha of the distribution of the maximum of the absolute of the studentized residuals (depending on the design matrix) is computed via Monte-Carlo simulations (with n_sims simulations).

Arguments

x

either a numeric variable or several numeric variables (explanatory variables) concatenated in a data frame. **Note:** `devianLM` does not add an intercept automatically; include a column of ones in `x` if an intercept is desired.

n_sims

optional value which is the number of simulations, is set to 50.000 by default.

nthreads

optional value which is the number of CPU cores to use, is set to "number of CPU cores - 1" by default.

quant

quantile of interest, is set to 0.95 by default (this corresponds to a risk level of 0.05).