censorContVar: Censor a vector of continuous numbers

Description Usage Arguments Value Author(s) Examples

View source: R/censorContVar.r

Description

Given a vector of realizations of a continuous random variable, interval-, left-, or right-censor these numbers at given boundaries. Useful when setting up simulations involving censored observations.

Usage

1
censorContVar(x, LLOD = NA, ULOD = NA)

Arguments

x

Vector of random numbers.

LLOD

Lower limit where x should be left-censored at. If no left-censoring, set to NA.

ULOD

Upper limit where x should be left-censored at. If no left-censoring, set to NA.

Value

A data.frame as specified by code = interval2 in Surv.

Author(s)

Stanislas Hubeaux, [email protected]

Kaspar Rufibach, [email protected]
http://www.kasparrufibach.ch

Examples

1
2
3
4
5
## random vector
x <- rnorm(200)

## interval-censor this vector at -1 and 0.5
censorContVar(x, -1, 0.5)

SurvRegCensCov documentation built on May 30, 2017, 3:32 a.m.