kmdiff function

Estimate of Milestone Survival Difference

Estimate of Milestone Survival Difference

Obtains the estimate of milestone survival difference between two treatment groups.

kmdiff( data, rep = "", stratum = "", treat = "treat", time = "time", event = "event", milestone = NA_real_, survDiffH0 = 0, conflev = 0.95 )

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 survival probability.

  • survDiffH0: The difference in milestone survival probabilities under the null hypothesis. Defaults to 0 for superiority test.

  • conflev: The level of the two-sided confidence interval for the difference in milestone survival probabilities. Defaults to 0.95.

Returns

A data frame with the following variables:

  • rep: The replication.
  • milestone: The milestone time relative to randomization.
  • survDiffH0: The difference in milestone survival probabilities under the null hypothesis.
  • surv1: The estimated milestone survival probability for the treatment group.
  • surv2: The estimated milestone survival probability for the control group.
  • survDiff: The estimated difference in milestone survival probabilities.
  • vsurv1: The variance for surv1.
  • vsurv2: The variance for surv2.
  • vsurvDiff: The variance for survDiff.
  • survDiffZ: The Z-statistic value.
  • survDiffPValue: The one-sided p-value.
  • lower: The lower bound of confidence interval.
  • upper: The upper bound of confidence interval.
  • conflev: The level of confidence interval.

Examples

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

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

  • Maintainer: Kaifeng Lu
  • License: GPL (>= 2)
  • Last published: 2025-03-20

Useful links