iscamsummary: Some Summary Statistics

View source: R/summary.R

iscamsummaryR Documentation

Some Summary Statistics

Description

summary calculates the five number summary, mean, and standard deviation of the quantitative variable x. An optional second, categorical variable can be specified and values will be calculated separately for each group. The number of digits in output can also be specified. Skewness is sample skewness: g_1 := \frac{m_3}{m_2^{3/2}}, where m_2 := \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2 and m_3 := \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^3 are the second and third central sample moments.

Usage

iscamsummary(x, explanatory = NULL, digits = 3)

Arguments

x

data to summarize.

explanatory

(optional) explanatory variable to group by.

digits

(optional) number of digits to round to, defaults to 3.

Value

A table with some summary statistics of x.

Examples

set.seed(0)
fake_data <- rnorm(30) # simulating some data
groups <- sample(c("group1","group2"), 30, TRUE)
iscamsummary(fake_data)
iscamsummary(fake_data, explanatory = groups, digits = 2) # with groups

ISCAM documentation built on Feb. 12, 2026, 5:07 p.m.