outlierSC: Handling outliers in single-case data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/outlierSC.R

Description

Identifies and drops outliers within a single-case data frame (scdf).

Usage

1
outlierSC(data, dvar, pvar, mvar, criteria = c("MAD", "3.5"))

Arguments

data

A single-case data frame. See scdf to learn about this format.

dvar

Character string with the name of the dependent variable. Defaults to the attributes in the scdf file.

pvar

Character string with the name of the phase variable. Defaults to the attributes in the scdf file.

mvar

Character string with the name of the measurement time variable. Defaults to the attributes in the scdf file.

criteria

Specifies the criteria for outlier identification. Set criteria = c("SD", 2) to define two standard deviations as limit. This is also the default setting. To use the 99% Confidence Interval use criteria = c("CI", 0.99). Set criteria = c("Cook", "4/n") to define any data point with a Cook's Distance greater than 4/n as an outlier, based on the Piecewise Linear Regression Model.

Value

data

A single-case data frame with substituted outliers.

dropped.n

A list with the number of dropped data points for each single-case.

dropped.mt

A list with the measurement-times of dropped data points for each single-case (values are based on the mt variable of each single-case data frame).

sd.matrix

A list with a matrix for each case with values for the upper and lower boundaries based on the standard deviation.

ci.matrix

A list with a matrix for each single-case with values for the upper and lower boundaries based on the confidence interval.

cook

A list of Cook's Distances for each measurement of each single-case.

criteria

Criteria used for outlier analysis.

N

Number of single-cases.

case.names

Case identifier.

Author(s)

Juergen Wilbert

See Also

Other data manipulation functions: fillmissingSC(), longSCDF(), rankSC(), scaleSC(), shiftSC(), smoothSC(), truncateSC()

Examples

1
2
3
4
5
6
7
8
9
## Identify outliers using 1.5 standard deviations as criterion
susanne <- rSC(level = 1.0)
res.outlier <- outlierSC(susanne, criteria = c("SD", 1.5))
plotSC(susanne, marks = res.outlier)

## Identify outliers in the original data from Grosche (2011) using Cook's Distance
## greater than 4/n as criterion
res.outlier <- outlierSC(Grosche2011, criteria = c("Cook", "4/n"))
plotSC(Grosche2011, marks = res.outlier)

scan documentation built on Feb. 12, 2021, 3:01 a.m.