Description Usage Arguments Details Value Author(s) References See Also Examples
Create r x 2 count and person-time table for calculating rates
1 2 |
... |
see details |
byrow |
Default is TRUE and single vector or collection of numbers is read in row-wise. Set to FALSE to read in column-wise. |
rev |
reverse order of "rows", "colums", "both", or "neither" (default) |
Creates r x 2 table with r exposure levels and 2 columns (counts and person-time exposed). Arguments can be one of the following:
(1) r x 2 table of the following form:
1 2 3 4 5 | Outcome
Exposure cases pyears
E = 0 (ref) a PT0
E = 1 b PT1
|
(2) Two numeric vectors: 1st should be vector of counts, and the 2nd vector should be vector of person-times at risk. For example,
1 2 3 |
(3) >= 4 numbers in the following order: a, PT0, b, PT1
(4) One numeric vector of the following form: c(a, PT0, b, PT1)
Returns r x 2 rate table, usually for additional analyses.
Tomas Aragon, aragon@berkeley.edu, http://www.phdata.science
none
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ##Breast cancer cases from radiation treatment for tuberculosis
##Rothman 1998, p. 238
bc0 <- 15
bc1 <- 41
py0 <- 19017
py1 <- 28010
##4 numbers
ratetable(bc0, py0, bc1, py1)
##1 vector
dat <- c(bc0, py0, bc1, py1)
ratetable(dat)
##2 vectors
cases <- c(bc0, bc1)
pyears <- c(py0, py1)
ratetable(bc.cases = cases, person.years = pyears)
##1 matrix
r238 <- matrix(c(41, 28010, 15, 19017), 2, 2)
dimnames(r238) <- list(c("BC cases", "Person-years"),
"Radiation" = c("Yes", "No"))
r238
r238b <- t(r238)
r238b
ratetable(r238b, rev = "r")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.