Learn R Programming

SurvivalTests (version 1.0)

Sdescribe: Descriptive Statistics

Description

Sdescribe produces number of observations (n), number of events (nE), and the mean survival with confidence limits for the mean.

Usage

Sdescribe(formula, data, level = 0.95, nM = 5000, na.rm = TRUE, 
	  verbose = TRUE)

Value

Returns a data.frame of output with class "Sdescribe".

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the survival times and rhs the corresponding groups + the status variable (1: non-censored, 0: censored).

data

a data frame containing the variables in formula.

level

the confidence level.

nM

a number of bootstrap samples.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Author

Malwane Ananda, Osman Dag

Examples

Run this code

library(survival)
lung$status <- ifelse(lung$status == 2, 1, 0)
lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High"))

library(SurvivalTests)
# \donttest{
Sdescribe(time~age+status, lung)
# }

Run the code above in your browser using DataLab