rmdiff {lrstat}R Documentation

Estimate of restricted mean survival time difference

Description

Obtains the estimate of restricted mean survival time difference between two treatment groups.

Usage

rmdiff(
  data,
  rep = "rep",
  stratum = "stratum",
  treat = "treat",
  time = "time",
  event = "event",
  milestone = NA_real_,
  rmstDiffH0 = 0,
  confint = 0.95,
  biascorrection = 0L
)

Arguments

data

The input data frame that contains the following variables:

  • rep: The replication for by-group processing.

  • stratum: The stratum.

  • treat: The treatment.

  • time: The possibly right-censored survival time.

  • event: The event indicator.

rep

The name of the replication variable in the input data.

stratum

The name of the stratum variable in the input data.

treat

The name of the treatment variable in the input data.

time

The name of the time variable in the input data.

event

The name of the event variable in the input data.

milestone

The milestone time at which to calculate the restricted mean survival time.

rmstDiffH0

The difference in restricted mean survival times under the null hypothesis. Defaults to 0 for superiority test.

confint

The level of the two-sided confidence interval for the difference in restricted mean survival times. Defaults to 0.95.

biascorrection

Whether to apply bias correction for the variance estimate of individual restricted mean survival times. Defaults to no bias correction.

Value

A data frame with the following variables:

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


df <- rmdiff(data = rawdata, rep = "iterationNumber",
             stratum = "stratum", treat = "treatmentGroup",
             time = "timeUnderObservation", event = "event",
             milestone = 12)
head(df)


[Package lrstat version 0.2.6 Index]