MaxLRtest function performs logrank, weighted logrank test such as
Fleming-Harrington test and maximum weighted logrank test depending on
the type and number of weight functions. Let \(w(x_t)\) denote the weight applied
at event time point \(t\), where \(x_t\) is the base function. There are three options
for base. If KM is used, \(x_t=1-S_t\), where \(S_t\)
is pooled Kaplan-Meier estimate of survival rate at time point t. A FH(1,0) test
needs a weight function \(1-x_t\). If Combined base is selected,
\(x_t=1-S^*_t\), where \(S^*_t=w_1S^1_t+w_0S^0_t\), the weighted average
of KM estimate of survival rate for treatment (\(S^1_t\)) and control group
(\(S^0_t\)). It is considered more robust in case of unbalanced data.
For option N, \(x_t=1-\frac{Y_t}{N}\), where \(Y_t\) is the subjects
at risk at time t and \(N\) is the total number of subjects.The Wilcoxon and
tarone test should use this base. The base \(x_t\) in all three cases is an
increasing function of time t. Function gen.wgt helps to generate the commonly
used weight functions.
Let \(\Lambda_1\) and \(\Lambda_0\) denote the cumulative hazard for
treatment and control group. The alternative of a two-sided test is
\(H_a: \Lambda_1 \neq \Lambda_0\). The "less" alternative
corresponds to \(H_a: \Lambda_1 < \Lambda_0\) and the "greater"
alternative is \(H_a: \Lambda_1 > \Lambda_0\).
A p-value is obtained from a multivariate normal distribution if multiple weights
are provided. The function pmvnorm from R package mvtnorm is used.
Because the algorithm is slightly seed-dependent,the p-value and critical value
is the average of 10 runs.