Description Usage Arguments Details Value Author(s) See Also Examples
Meant to be used in creating R matrix to be exported as a table
1 | medianFunc(data, nvar, gvar = NULL, digits = 1, IQR = TRUE)
|
data |
Data frame where nvar and gvar can be found |
nvar |
Character string of column in data of which medians will be calculated |
gvar |
Character string of column in data of which medians will be grouped by |
digits |
Number of decimals the numbers will be rounded to |
IQR |
Logical: If TRUE then median (IQR) is printed. If FALSE then median (range) is printed |
na.rm=TRUE is defaulted in the calculation of median and IQR or min and max
Returns a string of the format median (IQR or range) for each of the levels in gvar. If gvar is null then median (IQR or range) is returned for nvar.
University of Wisconsin-Madison Biostatistics and Medical Informatics Department, Scott Hetzel M.S.
meanFunc
1 2 3 4 5 | outcome <- rnorm(20)
group <- factor(rep(c("A", "B"), each = 10))
d.frame <- data.frame(outcome, group)
medianFunc(d.frame, "outcome", "group", IQR = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.