Description Usage Arguments Value See Also Examples
The function provides descriptive statistics for a continuous variable, possibly according to levels of one or several categorical variables.
1 2 3 4 |
formula |
A formula. See examples for syntax. |
data |
A data frame containing the variables indicated in the formula. |
digits |
A scalar indicating the number of decimal digits left when rounding the result of the statictics. |
x |
An object of class “univar”. |
... |
Further arguments to be passed to the functions. |
A list with components CALL
, tab
, nbfact
and digits
.
Component tab
is the data frame built according to the formula and function used in the call.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | tmp <- data.frame(
f1 = c(NA, rep("a", 2), rep("b", 5), NA, "a", "a"),
f2 = rep(c("c", "d"), times = c(5, 6)),
f3 = rep(c("e", NA, "f"), times = c(4, 1, 6)),
y1 = c(rnorm(n = 9, mean = 10, sd = 5), NA, 2.1)
)
tmp
univar(formula = y1 ~ f1, data = tmp)
univar(formula = y1 ~ f1, data = tmp, digits = 1)
tab <- univar(formula = y1 ~ f1, data = tmp)
tab$tab
univar(formula = y1 ~ 1, data = tmp)
univar(formula = y1 ~ f1 + f2, data = tmp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.