impute: Subjects a given vector to a given limit of detection.

View source: R/impute.R

imputeR Documentation

Subjects a given vector to a given limit of detection.

Description

impute puts a given vector (usually a column vector) under a given limit of detection (LOD) by imputing values below the LOD with a given impute scheme.

Usage

impute(v, limit, fill = "NA")

Arguments

v

The vector to impute (usually a column vector in a matrix).

limit

The percent of the vector to put under the LOD. Ex: if limit = 0.25 then the first quartile of the vector is put under the LOD.

fill

The impute scheme to use for values below LOD. Takes one of the following: "sqrt2", "-1", "mean", "NA", "status" (Default = "NA"). See below for descriptions of each.

Value

The imputed vector.

Options for fill

"sqrt2"

results in values below the LOD imputed as LOD/sqrt{2}.

"-1"

results in values below the LOD imputed as -1.

"mean"

imputes values below the LOD with the mean of those values below the LOD.

"NA"

replaces values below the LOD with NA missing values.

"status"

is a special option that returns a vector detailing whether or not values are below the given LOD or not.

See Also

corrupt_mat

Examples

mat <- matrix(rnorm(25), 5, 5)
mat[,1] <- impute(mat[,1], limit=0.4, fill="-1")

Columbia-PRIME/PCPhelpers documentation built on April 24, 2022, 7:57 p.m.