strate: Calculate incidence rates from time-to-event data

Description Usage Arguments Details Author(s) See Also Examples

View source: R/strate.R

Description

strate calculates incidence rates of the cohort.

Usage

1
2
strate(time, status, strata = NULL, data = NULL, fail = NULL,
  perPY = 1, rnd = 4)

Arguments

time

specify the timer interval when the subject is at risk

status

event of interest to calculate incidence: 1 for event, 0 for censored

strata

specify variable to calculate stratified rates

data

an optional data frame

fail

failure event

perPY

units to be used in reported rates

rnd

Rounding of numbers

Details

Rates of event occurrences, known as incidence rates are outcome measures in longitudinal studies. In most longitudinal studies, follow-up times vary due to logistic resasons, different periods of recruitment, delay enrolment into the study, lost-to-follow-up, immigration or emigration and death.

Follow-up time in longitudinal studies

Period of observation (called as follow-up time) starts when individuals join the study and ends when they either have an outcome of interest, are lost-to- follow-up or the follow-up period ends, whichever happens first. This period is called person-year-at-risk. This is denoted by PY in strate function's output and numer of event by D.

Rate

is calcluated using the following formula:

λ = D / PY

Confidence interval of rate

is derived using the following formula:

95\% CI (rate) = rate x Error Factor

Error Factor (rate) = exp(1.96 / √{D})

References:

  1. Essential Medical Statistics, Betty R. Kirkwood & Jonathan A.C. Sterne, Second Edition. Chapter 22, page 229 & 239

Author(s)

Myo Minn Oo (Email: dr.myominnoo@gmail.com | Website: https://myominnoo.github.io/)

See Also

isum, isum.by, tab, xtab

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data(lung)
str(lung)

## incidence rates
strate(time, status, data = lung)
strate(time, status, data = lung, per = 100000)

## stratified incidence rates
lung$sex <- factor(lung$sex, levels = c(1:2), labels = c('male', 'female'))
strate(time, status, sex, lung, per = 100000)
strate(time, status, inst, lung, per = 100000)

## End(Not run)

myominnoo/stats2 documentation built on Nov. 4, 2019, 8:33 p.m.