Description Usage Arguments Value See Also Examples
The function provides quantiles for a continuous variable, possibly according to levels of one or several categorical variables.
1 2 3 4 |
formula |
A formula with the numerical variable on the left-hand side and the categorical variable(s) on
the right-hand side.
When several categorical variables are included, they must be separated
by a |
data |
A data frame containing the variables indicated in the formula. |
probs |
A numeric vector of probabilities with values in [0,1]. |
digits |
A scalar indicating the number of decimal digits left when rounding the result of the statictics. |
x |
An object of class “quant”. |
... |
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 19 | 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
quant(formula = y1 ~ f1, data = tmp)
quant(formula = y1 ~ f1, data = tmp, digits = 1)
quant(formula = y1 ~ f1, data = tmp, probs = c(0.02, 0.50, 0.98))
tab <- quant(formula = y1 ~ f1, data = tmp)
tab$tab
quant(formula = y1 ~ 1, data = tmp)
quant(formula = y1 ~ f1 + f2, data = tmp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.