gen.wgt {nphPower}R Documentation

Weight Function Generation

Description

Generate commonly used weight functions for MaxLRtest function or pwr2n.NPH function

Usage

gen.wgt(method = c("LR"), param, theta = 0.5)

Arguments

method

a vector of text specifying the method(s). The method(s) must be one or some of c("LR", "FH", "Wilcoxon", "Tarone","Maxcombo","Maxcross"). Default: c("LR")

param

a vector of length 2. If FH method is selected, \rho and \gamma parameters must be provided, Default: 1

theta

a value within (0,1). If method Maxcross is selected, theta should be specified. See details. Default: 0.5

Details

The weight function for Fleming-Harrington (FH) test is S(t)^\rho(1-S(t)^\gamma). If FH test is specified, both \rho and \gamma should be provided. The weight for Tarone and Ware test is y(t)^{1/2}, where y(t) is number of subjects at risk. The weight for Wilcoxon test is y(t). See Klein (2003) for more details about all those tests. Both Maxcombo test and test proposed by Cheng and He (2021) need four weight functions. Cheng's method is more sensitive in detecting crossing hazards. A nuisance parameter theta is required to be specified. Parameter theta represents the Cumulative Density Function (CDF) at the crossing time point. If the hazards crossing occurs when few events occur yet, a small value should be chosen. The default value is 0.5.

Function MaxLRtest supports different base functions including pooled Kaplan-Meier (K-M) version of CDF functions rather than K-M survival functions. Therefore, if a F(0,1) test is requested, the returned function is function(x) {x}, where x denotes the estimated CDF for KM base. All the supported base functions are increasing over time.

Value

a list of weight function(s).

References

Klein, J. P., & Moeschberger, M. L. (2003). Survival analysis: techniques for censored and truncated data (Vol. 1230). New York: Springer.

Cheng, H., & He, J. (2021). A Maximum Weighted Logrank Test in Detecting Crossing Hazards. arXiv preprint arXiv:2110.03833.

See Also

MaxLRtest, pwr2n.NPH

Examples

#logrank test
gen.wgt(method="LR")
# FH and logrank test
  fn <- gen.wgt(method=c("FH","LR"), param = c(1,1))
# maximum weighted logrank test proposed by Cheng, including weight
# for detecting crossing hazards
  wcross <- gen.wgt(method="Maxcross", theta = c(0.2))

[Package nphPower version 1.1.0 Index]