Ocens: Censored Ordinal Variable

View source: R/Ocens.r

OcensR Documentation

Censored Ordinal Variable

Description

Combines two variables ⁠a, b⁠ into a 2-column matrix, preserving label and units attributes and converting character or factor variables into integers and added a levels attribute. This is used to combine censoring points with regular points. If both variables are already factors, their levels are distinctly combined starting with the levels for a. Character variables are converted to factors.

Usage

Ocens(a, b = a)

Arguments

a

variable for first column

b

variable for second column

Details

Left censored values will have -Inf for a and right-censored values will have Inf for b. Interval-censored observations will have b > a and both finite. For factor or character variables it only makes sense to have interval censoring.

If there is no censoring, a is returned as an ordinary vector, with label and units attributes.

Value

a numeric matrix of class Ocens

Author(s)

Frank Harrell


rms documentation built on April 12, 2025, 1:18 a.m.

Related to Ocens in rms...