Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nc

Add number censored.


Description

Add number censored.

Usage

nc(x, ...)

## S3 method for class 'ten'
nc(x, ...)

## S3 method for class 'stratTen'
nc(x, ...)

Arguments

x

An object of class ten or stratTen.

...

Additional arguments (not implemented).

Value

The original object, with new column(s) added indicating the number censored at each time point, depending on attr(x, "shape"):

"long"

the new column, c, gives the number censored at each timepoint, by covariate group.

"wide"

new columns, beginning with c_, give the number censored at each timepoint, by covariate group. There is an additional nc column giving the total number censored at each timepoint.

A stratTen object has each ten element in the list modified as above.

Examples

data("kidney", package="KMsurv")
t1 <- ten(survfit(Surv(time, delta) ~ type, data=kidney))
nc(t1)
nc(asWide(t1))

## stratified model
data("pbc", package="survival")
t1 <- ten(coxph(Surv(time, status==2) ~ log(bili) + age + strata(edema), data=pbc))
nc(t1)

survMisc

Miscellaneous Functions for Survival Data

v0.5.5
GPL-2
Authors
Chris Dardis
Initial release
2018-07-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.