mantelhaen.pt.test: Mantel-Haenszel Test of association for person-time data

Description Usage Arguments Value References Examples

Description

Performs a Mantel-Haenszel test of the null that the hazard ratio is 1 for all exposure categories, relative to the reference category. A warning is given if any expected count is less than 5, along with the offending expected count(s).

Usage

1
mantelhaen.pt.test(time, status, exposure)

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.

Value

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

statistic

The Mantel-Haenszel X-squared chi-square test statistic.

p.value

The p-value of the test.

estimate

Hazard ratio estimates. The reference level is 1.

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 216.

Examples

1
2
3
4
5
6
## Example 10.12
with(breast.survival, mantelhaen.pt.test(time, status, stage))

## Example 10.13, assessment of the Poisson-Exponential Assumption
mantelhaen.pt.test(time = c(2363, 7108), status = c(5,44), exposure = gl(n = 2, k = 1))
## p = 0.017; moderate evidence of unequal hazard rates in the two time intervals.

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