powered by
Describe rates using the Surv function.
Surv
survRate(formula, data, subset, addvars = TRUE, ci=TRUE, ...)
data-frame with columns tstop, event, rate, lower and upper. Covariates are appended if addvar=TRUE.
tstop
event
rate
lower
upper
addvar=TRUE
Confidence intervals use stats::poisson.test.
stats::poisson.test
formula with the left-hand-side being a Surv function and the right-hand-side being any stratification variables.
source dataset
subset conditions for the source dataset
logical for whether to add the stratification variables to the output (default=TRUE). This is useful for subsequent analysis.
logical for whether to calculate the confidence interval (default=TRUE).
other arguments to the poisson.test function for calculation of the confidence intervals.
poisson.test
## incidence rates for CHD for low- or high-energy diets survRate(Surv(y,chd) ~ hieng, data=diet)
Run the code above in your browser using DataLab