Learn R Programming

compeir (version 1.0)

irates.ratio: Ratio between two event-specific incidence rates

Description

This function computes event-specific incidence rate ratios between two groups. Each group is given by a covariate value.

Usage

irates.ratio(irates, covar.code, ci.fun = NULL, ci.level = NULL)

Arguments

irates
irates object
covar.code
A vector of character or numerical values that specifies the covariate values in irates to be compared. The vector must contain two values, the order specifies the ratio
ci.fun
A character value out of c(“lin”, “log”) that specifies the confidence interval function, either linear or log-transformed. If NULL, ci.fun is inherited from irates
ci.level
A numerical value between 0 and 1 that specifies the level for the two-sided confidence interval. If NULL, ci.level is inherited from irates

Value

An object of class irates.ratio. This object is implemented as a list of the (besides pre-specified) following items:
irr
Competing events incidence rate ratios
var
Variance estimates for competing events incidence rate ratios
conf.lower
Lower confidence interval corresponding to pre-specified function and level
conf.upper
Upper confidence interval corresponding to pre-specified function and level

See Also

print.irates.ratio

Examples

Run this code
### Example data.frame with aggregated count data
dat <- data.frame(
			times = c(7948,2899), 
			no.event = c(6,8), 
			event.1 = c(589,68), 
			event.2 = c(55,21), 
			row.names = c("covar0","covar1"))  

### Compute irates object from dat
ir <- irates(dat)

### Compute incidence rate ratios from irates object
irates.ratio(
		ir, 
		covar.code = c("covar1", "covar0"))

Run the code above in your browser using DataLab