Obtains the log-rank test using the Fleming-Harrington family of weights.
lrtest(
data,
rep = "",
stratum = "",
treat = "treat",
time = "time",
time2 = "",
event = "event",
weight = "",
weight_readj = FALSE,
rho1 = 0,
rho2 = 0
)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 two-sided p-value.
weight_readj: Whether the weight variable will be readjusted.
rho1: The first parameter of the Fleming-Harrington weights.
rho2: The second parameter of the Fleming-Harrington weights.
rep: The replication.
The input data frame that contains the following variables:
rep: The replication for by-group processing.
stratum: The stratum.
treat: The treatment.
time: The follow-up time for right censored data, or
the left end of each interval for counting process data.
time2: The right end of each interval for counting process
data. Intervals are assumed to be open on the left
and closed on the right, and event indicates whether an event
occurred at the right end of each interval.
event: The event indicator, 1=event, 0=no event.
weight: The weight for each observation.
The name(s) of the replication variable(s) in the input data.
The name(s) of the stratum variable(s) in the input data.
The name of the treatment variable in the input data.
The name of the time variable or the left end of each interval for counting process data in the input data.
The name of the right end of each interval for counting process data in the input data.
The name of the event variable in the input data.
The name of the weight variable in the input data.
Whether the weight variable at each event time
will be readjusted to be proportional to the number at risk by
treatment group. Defaults to FALSE.
The first parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.
The second parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.
Kaifeng Lu, kaifenglu@gmail.com
df <- lrtest(data = rawdata, rep = "iterationNumber",
stratum = "stratum", treat = "treatmentGroup",
time = "timeUnderObservation", event = "event",
rho1 = 0.5, rho2 = 0)
head(df)
Run the code above in your browser using DataLab