hazard.ratio.test: Hazard Ratio Test of association for unstratified survival...

Description Usage Arguments Value References Examples

Description

Performs a test of the null that the hazard ratio between two groups is 1.

Usage

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

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 two levels indicating exposure. The first level is assumed to be the exposed condition.

Wald

a logical indicating whether to use the Wald or Likelihood Ratio Test. Default is TRUE.

conf.level

confidence level of the returned confidence interval. Must be a single number between 0 and 1. Default is 0.95.

exact

a logical indicating whether the asymptotic (unconditional) test or the exact test should be computed. Default is FALSE. The "Wald" argument is ignored when set to TRUE.

rev

a logical indicating to whether to reverse the order of the factor levels when estimating the hazard ratio.

Value

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

statistic

The chi-square test statistic. Only returned if "exact = FALSE".

p.value

The p-value of the test.

estimate

Hazard ratio estimate.

null.value

The null hazard ratio, which is currently set to 1.

alternative

A character string describing the alternative hypothesis. Currently only "two.sided".

method

A character string indicating the method employed.

data.name

A character string giving the name of the data.

References

Newman (2001), page 206 - 213.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Example 10.8
with(breast.survival, hazard.ratio.test(time, status, receptor.level))
with(breast.survival, hazard.ratio.test(time, status, receptor.level, Wald = FALSE))
## Example 10.9
## Receptor Level-Breast Cancer: Stage III
dat <- subset(breast.survival, stage=="III")
hazard.ratio.test(time = dat$time, status = dat$status, exposure = dat$receptor.level)
hazard.ratio.test(time = dat$time, status = dat$status, exposure = dat$receptor.level, 
                  Wald = FALSE)
## Example 10.10
hazard.ratio.test(time = dat$time, status = dat$status, exposure = dat$receptor.level, 
                  exact = TRUE)

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