rmtfit: Estimate restricted mean times in favor of treatment

Description Usage Arguments Value Methods (by class) See Also Examples

View source: R/functions.R

Description

Estimate and make inference on the overall and component-wise restricted mean times in favor of treatment.

Usage

1
2
3
4
5
6
7
rmtfit(...)

## Default S3 method:
rmtfit(id, time, status, trt, type = "multistate", ...)

## S3 method for class 'formula'
rmtfit(formula, data, ...)

Arguments

...

Further arguments.

id

A vector of id variable.

time

A vector of follow-up times.

status

For type="multistate", k = entering into state k (K+1 represents death) and 0 = censoring; For type="recurrent", 1 = recurrent event, 2 = death, and 0 = censoring;

trt

A vector of binary variable for treatment group.

type

"multistate" = multistate data; "recurrent" = recurrent event data.

formula

A formula object. For multistate data, use ms(id,time,status)~trt; for recurrent event data, use rec(id,time,status)~trt.

data

A data frame, which contains the variables names in the formula.

Value

An object of class rmtfit. See rmtfit.object for details.

Methods (by class)

See Also

rmtfit.object, summary.rmtfit, plot.rmtfit, bouquet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#######################
# Multistate outcome  #
#######################
# load the colon cancer trial data
library(rmt)
head(colon_lev)
# fit the data
obj=rmtfit(ms(id,time,status)~rx,data=colon_lev)
# print the event numbers by group
obj
# summarize the inference results for tau=7.5 years
summary(obj,tau=7.5)

############################
# Recurrent event outcome  #
############################
# load the HF-ACTION trial data
library(rmt)
head(hfaction)
# fit the data
obj=rmtfit(rec(patid,time,status)~trt_ab,data=hfaction)
# print the event numbers by group
obj
# summarize the inference results for tau=3.5 years
summary(obj,tau=3.5,Kmax=4) # aggregating results for recurrent-event
# frequency >=4.

rmt documentation built on May 25, 2021, 9:06 a.m.