Description Usage Arguments Value Examples
Do numerical summaries by groups with formaula interface. Missing values are automatically removed.
1 2 3 4 5 6 7 8 9 10 11 12 | do_summary(
y,
data = NULL,
stat = c("n", "missing", "mean", "trimmed", "sd", "variance", "min", "Q1", "median",
"Q3", "max", "mad", "IQR", "range", "cv", "se", "skewness", "kurtosis"),
trim = 0.1,
type = 3,
na.rm = TRUE
)
## S3 method for class 'num_summaries'
print(x, ..., digits = NA, format = "f", digits_sk = 2)
|
y |
formula with variable names to summarize. See more in examples. |
data |
data set |
stat |
(character) Descriptive statistics to compute. Currently supported statistics:
|
trim |
The fraction (0 to 0.5) of observations to be trimmed from each end of sorted variable before the mean is computed. Values of trim outside that range are taken as the nearest endpoint. |
type |
(integer: 1, 2, 3) The type of skewness and kurtosis estimate.
See |
na.rm |
(logical) Flag to remove missing values. Default is |
x |
object to print |
... |
further arguments to methods. |
digits |
Number of digits for descriptive statistics. |
format |
(character) |
digits_sk |
Number of digits for skweness and kurtosis. |
Data frame with summary satatistics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(biostat)
data(cabbages, package = "MASS")
do_summary(~VitC, data = cabbages) %>%
print(digits = 2)
do_summary(VitC ~ Cult, data = cabbages) %>%
print(digits = 2)
do_summary(VitC ~ Cult + Date, data = cabbages, stat = "mean") %>%
print(digits = 2)
do_summary(HeadWt + VitC ~ Cult + Date,
data = cabbages,
stat = c("n", "mean", "sd")
) %>%
print(digits = 1)
# TODO:
# 1. First argument should be a data frame
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.