getRowsOutlierRemoval: Identify row numbers for outlier removal

Description Usage Arguments Value Examples

View source: R/regression.R

Description

Function removes outliers at a relative percentage at both ends.

Usage

1
getRowsOutlierRemoval(model, cutoff = 0.5)

Arguments

model

Object of type lm.

cutoff

Relative cutoff on each side in percent (default: 0.5, i.e. 0.5% at each end).

Value

Returns vector with indices of the observations to be removed.

Examples

1
2
3
4
5
6
d <- data.frame(x = 1:200, y = 1:200 + rnorm(200))
m <- lm(y ~ x, d)

idx_rm <- getRowsOutlierRemoval(m)

m <- lm(y ~ x, d[-idx_rm, ])

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.