censorImpute: Censor Impute

Description Usage Arguments Details Value Examples

View source: R/censor_functions.R

Description

This function will take already censored data and replace LOD with LOD/sqrt2 or another value.

Usage

1
censorImpute(cenData, replacement = LOD/sqrt(2))

Arguments

cenData

Data matrix such that the first half of the columns are the censored data and the second half are the isCensored flags with 1 indicating censored and 0 indicating not censored, where censored data has a value equal to the limit of detection.

replacement

The value request to fill censored values inplace of the LOD in the censored data matrix. By Defualt equals LOD divided by sqrt2 as this is a common method.

Details

To change the censored values to LOD/sqrt2 the data passed to the function must be censored such that censored values = LOD. If LOD is not availible, replacement should only equal numerical values.

Value

Matrix such that the first half of the columns are the censored data and the second half are the isCensored flags with 1 indicating censoring, where censored data has a value equal to replace parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
xmu = 0
ymu = 0
xsd = 1
ysd = 1
r = 0
df = 4 #t with 4 degrees of freedom
scaleMat <- buildScaleMat( xsd, ysd, r, df)
myData <- genData(10, c(xmu, ymu), scaleMat, df)
LODcenored <- censorData(uncenData = myData, cenLevelVec =c(.2,.2))
LODoverSQRT2censored <- censorImpute(LODcensored) #using defual replacement
ZEROcensored <- censorImpute(LODcensored, replacemnt = 0) #using numerical replacement

senresearch/lcest documentation built on Jan. 14, 2022, 5:29 p.m.