rmst: Calculate the RMST in each arm and the between-group...

Description Usage Arguments Details Value Examples

View source: R/functions.R

Description

This function calculates an estimate of the RMST using the specified method

Usage

1
rmst(formula, data, trunc, alpha, method = c("KM", "pseudo", "RP"), ...)

Arguments

formula

A formula object, with the response on the left of a ~ operator, and the a single term for arm on the right. The response must be a survival object as returned by the Surv function.

data

A data.frame in which to interpret the variables named in the formula.

trunc

The time point to truncated the estimate of the RMST at.

alpha

The default is 0.05. (1-alpha) confidence intervals are reported.

method

The method to estimate the RMST. Note that 2 knots will be used by default when using the Royston-Parmar method unless otherwise specified.

...

Additional arguments to be passed to the method

Details

The RMST is estimate which can be found by calculating the area under the survival curve. This function facilitates the implementation the three most discussed approaches in current literature. For further details on how the RMST is calculated for each method see the document for the appropriate method, i.e. ?rmstKM, ?rmstPseudo, or ?rmstRP.

Value

The Restricted Mean Survival Time computated

Examples

1
2
3
4
5
# Load in an example data set
D <- rmst2.sample.data()

# Calculate the RMST using pseudovalues
rmst(Surv(time, status) ~ arm, data=D, trunc=5, alpha=0.05, method="pseudo")

scientific-computing-solutions/RMST documentation built on May 14, 2019, 10:35 a.m.