k.hazard.ratio.test: Hazard Ratio Test of association for survival data with k...

Description Usage Arguments Value References See Also Examples

Description

Performs a test of the null that the hazard ratio between k strata is 1.

Usage

1
2
k.hazard.ratio.test(time, status, exposure, strata, Wald = TRUE,
  conf.level = 0.95)

Arguments

time

a numeric vector of survival times.

status

a numeric vector of censoring indicators, with 0 = censored and 1 = dead.

exposure

a factor vector with at least two levels indicating exposure. The first level is assumed to be the exposed condition.

strata

a factor vector with at least two levels indicating strata.

Wald

a logical indicating whether to use the Wald or Likelihood Ratio Test. Default is TRUE. Only used in the 2 by 2 by K case.

conf.level

confidence level of the returned confidence interval. Must be a single number between 0 and 1. Default is 0.95. Only used in the 2 by 2 by K case.

Value

A list with class "htest" containing the following components:

statistic

The chi-square test statistic.

parameter

The degrees of freedom of the approximate chi-squared distribution of the test statistic.

p.value

The p-value of the test.

estimate

Common hazard ratio estimate. Only present in the 2 by 2 by K case.

null.value

The null common hazard ratio, which is currently set to 1. Only present in the 2 by 2 by K case.

alternative

A character string describing the alternative hypothesis. Currently only "two.sided". Only present in the 2 by 2 by K case.

method

A character string indicating the method employed.

data.name

A character string giving the name of the data.

References

Newman (2001), page 219 - 221, 226.

See Also

hazard.ratio.test for unstratified survival data and hazard.ratios for calculating estimated hazard ratios of stratified survival data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Example 10.14
with(breast.survival, 
     k.hazard.ratio.test(time = time, status = status, 
                         exposure = receptor.level, strata = stage))
                         
## LR Test 
with(breast.survival, 
     k.hazard.ratio.test(time = time, status = status,
                         exposure = receptor.level, strata = stage, 
                         Wald=FALSE))
                         
## Example 10.18 - polychotomous exposure
with(breast.survival, 
     k.hazard.ratio.test(time = time, status = status,
                         exposure = stage, strata = receptor.level))

clayford/bme documentation built on May 13, 2019, 7:37 p.m.