lrtest function

Log-Rank Test of Survival Curve Difference

Log-Rank Test of Survival Curve Difference

Obtains the log-rank test using the Fleming-Harrington family of weights.

lrtest( data, rep = "", stratum = "", treat = "treat", time = "time", event = "event", rho1 = 0, rho2 = 0 )

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.

  • rho1: The first parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.

  • rho2: The second parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.

Returns

A data frame with the following variables:

  • uscore: The numerator of the log-rank test statistic.
  • vscore: The variance of the log-rank score test statistic.
  • logRankZ: The Z-statistic value.
  • logRankPValue: The one-sided p-value.
  • rho1: The first parameter of the Fleming-Harrington weights.
  • rho2: The second parameter of the Fleming-Harrington weights.
  • rep: The replication.

Examples

df <- lrtest(data = rawdata, rep = "iterationNumber", stratum = "stratum", treat = "treatmentGroup", time = "timeUnderObservation", event = "event", rho1 = 0.5, rho2 = 0) head(df)

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

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

Useful links