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

Description Usage Arguments Value Examples

Description

This function calculates an estimate of the RMST by fitting a Royston-Parmar model to the survival data with arm as a covariate. The model is fit using the function flexsurvspline from the package flexsurv. For further information see the flexsurv documentation. The standard errors are calculated using the Delta method.

Usage

1
rmstRP(formula, data, trunc, alpha = 0.05, knots = 2)

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.

knots

the number of internal knots to fit the Royston-Parmar model with.

Value

The Restricted Mean Survival Time computated by fitting Royston-Parmar model to the survival data

Examples

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

# Calculate the RMST based on the Royston-Parmar model with two knots
rmstRP(Surv(time, status) ~ arm, data=D, trunc=5, alpha=0.05, knots=2)

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