SurvtoLR: Transform Surv object to data matrix with L and R columns

Description Usage Arguments Details Value References Examples

View source: R/SurvtoLR.R

Description

Take a Surv object and transforms it into a data matrix with two columns, L and R, representing the left and right points of observed time intervals. For right-censored data, R = NA.

Usage

1

Arguments

x

a Surv object

Details

The input Surv object should be in the form of Surv(L,R,type='interval2'), where R = NA for right-censored data.

Value

A data matrix with two variables:

L

left-points of observed time intervals

R

right-points of observed time intervals

References

Michael P. Fay, Pamela A. Shaw (2010). Exact and Asymptotic Weighted Logrank Tests for Interval Censored Data: The interval R Package. Journal of Statistical Software, 36 1-34.

Examples

1
2
3
4
5
library(survival)
L<-c(45,6,0,46)
R<-c(NA,10,7,NA)
y<-Surv(L,R,type='interval2')
SurvtoLR(y)

ICBayes documentation built on Feb. 1, 2020, 1:07 a.m.