Learn R Programming

cohorttools (version 0.1.6)

mkratetable: Function makes rate table with confidence intervals for crude incidences (rates)

Description

Function makes rate table with confidence intervals for crude incidences (rates)

Usage

mkratetable(formula, data, alpha = 0.05, add.RR = FALSE, lowest.N = 0, ...)

Value

table with columns named after marginal variables and n, event, incidence, se, exact.lower95ci and exact.upper95ci variables

Arguments

formula

where Surv object is on lhs and marginal variable(s) on rhs. Marginal variables should usually be factors

data

data.frame to be used

alpha

confidence level, default is 0.05

add.RR

should rate ratio (RR) be added

lowest.N

lowest frequency to be shown

...

additional parameter for function survival::pyears

Author

Jari Haukka jari.haukka@helsinki.fi

See Also

survival pyears

Examples

Run this code
library(survival)
tmp.lt1<-mkratetable(Surv(time,status)~ sex,data=lung)
tmp.lt2<-mkratetable(Surv(time,status)~ sex+ph.ecog,data=lung,add.RR=TRUE,lowest.N=10)

Run the code above in your browser using DataLab