censorData: Left Censor Data

Description Usage Arguments Details Value Examples

View source: R/censor_functions.R

Description

This function will take a data set and artificially left censor it to a requested level of censoring.

Usage

1
censorData(uncenData, cenLevelVec)

Arguments

uncenData

Data matrix to be censored.

cenLevelVec

Vector of length equal to rows of data, indicating censoring level requested in decimals.

Details

The function sets the limit of detection at the value which the requested amount of data is below. All values below this limit of detection are replaced with the limit of detection.

Value

Matrix such that the first half of the columns are the censored data and the second haf 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.

Examples

1
2
3
4
5
6
7
8
9
xmu = 0
ymu = 0
xsd = 1
ysd = 1
r = 0
df = Inf #normal
scaleMat <- buildScaleMat( xsd, ysd, r, df)
myData <- genData(10, c(xmu, ymu), scaleMat, df)
censorData(uncenData = myData, cenLevelVec =c(.2,.2))

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