lrtest {lrstat} | R Documentation |
Log-rank test of survival curve difference
Description
Obtains the log-rank test using the Fleming-Harrington family of weights.
Usage
lrtest(
data,
rep = "rep",
stratum = "stratum",
treat = "treat",
time = "time",
event = "event",
rho1 = 0,
rho2 = 0
)
Arguments
data |
The input data frame that contains the following variables:
|
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. |
Value
A data frame with the following variables:
-
rep
: The replication. -
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.
Author(s)
Kaifeng Lu, kaifenglu@gmail.com
Examples
df <- lrtest(data = rawdata, rep = "iterationNumber",
stratum = "stratum", treat = "treatmentGroup",
time = "timeUnderObservation", event = "event",
rho1 = 0.5, rho2 = 0)
head(df)